Modify TP/SL
This section documents the modify_tpsl action
Some orders types are protected and won't be canceled by this action:
TP/SL attached to resting limit orders
Reduce-only limit orders
Example Request
This example modifies the current open BTC position TP/SL using a 0% stop-loss (break-even), a 2% take-profit, an additional 1% partial take-profit with 25% size, and another additional fixed 120,500 take-profit with 50% size.
{
"action": "modify_tpsl",
"coin": "BTC",
"tp_pct": 2,
"sl_pct": 0,
"tps": [
{"price_pct": 0.01, "size_pct": 0.25},
{"price": 120500, "size_pct": 0.5}
],
"bot_id": BOT_ID,
"api_key": "API_KEY"
}coin*
This required parameter indicates which coin to use for the action.
Take-Profit & Stop-Loss
These parameters allows you to add position take-profit and stop-loss orders.
sl_pct
This parameter specifies the % from entry to modify your stop-loss.
A value of
0.01is equal to a1% stop-loss
tp_pct
This parameter specifies the % from entry to modify your take-profit.
A value of
0.01is equal to a1% take-profit
sl
This parameter specifies a direct price to modify your stop-loss.
tp
This parameter specifies a direct price to modify your take-profit.
Multiple Take-Profit & Stop-Loss
These parameters allows you to place multiple take-profit and stop-loss orders.
tps
This parameter allows you to place multiple take-profit orders.
You can specify TPs using a percentage from entry or a direct price:
A
tp_pctvalue of0.01is equal to a1% take-profitA
tpvalue of120500indicates adirect priceto place your take-profit.
A
size_pctvalue of0.5will close50%of your order
sls
This parameter allows you to place multiple stop-loss orders.
You can specify SLs using a percentage from entry or a direct price:
A
sl_pctvalue of0.01is equal to a1% stop-lossA
slvalue of120500indicates adirect priceto place your stop-loss.
A
size_pctvalue of1will close100%of your order
delay
This parameter specifies 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?