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.
True
will close only Long positionsFalse
will close only Short positions
"is_buy": true
Sizes
size
This parameter indicates a size in contracts.
A value of
0.005
is equal to0.005 BTC
"size": 0.005
size_usd
This parameter indicates a size in USD.
A value of
100
is equal to$100 USD
"size_usd": 100
size_pct
This parameter indicates a size in percentage of current position.
A value of
0.1
is equal to10%
of current position sizeMax. allowed value is
1
(100% of current position size)
"size_pct": 0.1
slippage_pct
This parameter indicates the Max. % slippage allowed for the trade to execute.
A value of
0.05
is equal to5%
"slippage_pct": 0.05
delay
This parameter indicates a number of seconds to wait before triggering the action.
A value of
5
is equal to a5 seconds
delayMax. allowed delay is
10 seconds
"delay": 5
Last updated
Was this helpful?