Close Position
This section documents the close_position action
Example Request
This example partially closes a long position on BTC using 50% of the current position size.
{
"action": "close_position",
"coin": "BTC",
"is_buy": true,
"size_pct": 0.5,
"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 parameter indicates the position's direction to close.
Truewill close only Long positionsFalsewill close only Short positions
Sizes
size
This parameter indicates a size in contracts.
A value of
0.005is equal to0.005 BTC
size_usd
This parameter indicates a size in USD.
A value of
100is equal to$100 USD
size_pct
This parameter indicates a size in percentage of current position.
A value of
0.1is equal to10%of current position sizeMax. allowed value is
1(100% of current position size)
slippage_pct
This parameter indicates the Max. % slippage allowed for the trade to execute.
A value of
0.05is equal to5%
delay
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
Last updated
Was this helpful?