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.
"coin": "BTC"
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.01
is equal to a1% stop-loss
"sl_pct": 0.01
tp_pct
This parameter specifies the % from entry to modify your take-profit.
A value of
0.01
is equal to a1% take-profit
"tp_pct": 0.01
sl
This parameter specifies a direct price to modify your stop-loss.
"sl": 62500
tp
This parameter specifies a direct price to modify your take-profit.
"tp": 72500
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_pct
value of0.01
is equal to a1% take-profit
A
tp
value of120500
indicates adirect price
to place your take-profit.
A
size_pct
value of0.5
will close50%
of your order
"tps": [
{"tp_pct": 0.01, "size_pct": 0.5},
{"tp": 120500, "size_pct": 1}
]
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_pct
value of0.01
is equal to a1% stop-loss
A
sl
value of120500
indicates adirect price
to place your stop-loss.
A
size_pct
value of1
will close100%
of your order
"sls": [
{"sl_pct": 0.01, "size_pct": 0.5},
{"sl": 120500, "size_pct": 1}
]
delay
This parameter specifies 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?