Limit Order
This section documents the limit_order action
Example Request
This example will open a long position on BTC at a price of 100,000 using a size of $100 USD, with 1% stop-loss and 2% take-profit
{
"action": "limit_order",
"coin": "BTC",
"is_buy": true,
"price": 100000,
"size_usd": 100,
"sl_pct": 0.01,
"tp_pct": 0.02,
"reduce_only": false,
"bot_id": BOT_ID,
"api_key": "API_KEY"
}This example will close a long position on BTC at a price of 105,000 using 100% of current position size
{
"action": "market_order",
"coin": "BTC",
"is_buy": false,
"price": 105000,
"size_pct": 1,
"reduce_only": true,
"bot_id": BOT_ID,
"api_key": "API_KEY"
}coin*
This required parameter indicates which coin to use for the action.
"coin": "BTC"is_buy*
This required parameter indicates the direction of the trade.
Truecan open a Long position or close a Short positionFalsecan open a Short position or close a Long position
"is_buy": truereduce_only*
This required parameter indicates whether the order is allowed to only reduce position size or not.
This parameter is only available for Perps.
A value of
truewill only allow closing/reducing positionA value of
falsewill allow both opening and closing position
"reduce_ony": trueprice*
This required parameter indicates the price to place the order.
A value of
105000places a limit order at the price105,000
"price": 105000Sizes*
size
This parameter indicates a size.
A value of
0.005is equal to0.005 BTC
"size": 0.005size_usd
This parameter indicates a size in USD.
A value of
100is equal to$100 USD
"size_usd": 100size_pct
This parameter indicates either a size in percentage of available balance when opening an order, or a size in percentage of current position when closing an order.
A value of
0.1is equal to10%
"size_pct": 0.1Take-Profit & Stop-Loss
These parameters allows you to add single take-profit and stop-loss orders.
This parameter is only available for Perps.
sl_pct
This parameter indicates the % from entry to place your stop-loss.
A value of
0.01is equal to a1% stop-loss
"sl_pct": 0.01tp_pct
This parameter indicates the % from entry to place your take-profit.
A value of
0.01is equal to a1% take-profit
"tp_pct": 0.01sl
This parameter indicates a direct price to place your stop-loss.
"sl": 62500tp
This parameter indicates a direct price to place your take-profit.
"tp": 72500delay
This parameter indicates a number of seconds to wait before triggering the action.
A value of
5is equal to a5 secondsdelayMax. allowed delay is
10 seconds
"delay": 5Last updated
Was this helpful?