Set / update / clear take-profit & stop-loss
pionex_bot_update_trigger_profit_loss_futures_gridSet, update, or clear take-profit and stop-loss triggers on an already running futures grid order, using price, ratio, or amount thresholds.
Instructions
Set / update / clear take-profit & stop-loss
Set, update, or clear the take-profit and/or stop-loss of an already running futures grid order. Weight: 1.
This does NOT create triggers for a not-yet-started order — use create (fields
lossStopType / profitStopType etc.) for that. This endpoint mutates the
take-profit / stop-loss of an existing order in place.
Request field naming: unlike the other futuresGrid endpoints (which use
camelCase), this endpoint takes snake_case field names, and the trigger
settings are passed as a list of items — one item per trigger you want to set.
A single call may contain a stop_loss item, a stop_profit item, or both.
type — which trigger the item configures. Only two values are accepted
(App-side legacy spellings such as stop-loss and the entry-trigger value
condition are rejected here):
| Meaning |
| Configure the stop-loss trigger |
| Configure the take-profit trigger |
stop_type — decides how value (and limit_price) is interpreted.
Required; unlike the App, an empty value is NOT accepted (no implicit
fallback to price):
|
|
|
| Trigger price | ignored |
| Trigger price; order is placed as a limit order at | required |
| Profit/loss amount in the settlement currency | ignored |
| Profit/loss ratio (e.g. | ignored |
Clearing a trigger: pass value as an empty string "" for that item to
remove the previously set take-profit / stop-loss.
value validation: when value is non-empty it only needs to be a valid
decimal — the endpoint does not enforce a positive value. 0 and negative values
are accepted (a stop-loss expressed as a negative profit_ratio / profit_amount
is meaningful).
Neutral grid (no_trend) upper stop-loss: for a neutral grid, a stop-loss can
additionally set an upper threshold above the grid range using
stop_high_price (and limit_high_price when stop_type=price_limit). These two
fields apply only to a stop_loss item on a neutral grid and only when
stop_type is price or price_limit; they are ignored otherwise.
*_sell_model — settlement currency for the position closed by the trigger.
Optional; when empty the order's default is used:
Value | Meaning |
| Settle to the quote currency |
| Settle to USDT |
Use loss_stop_sell_model on a stop_loss item and profit_stop_sell_model on a
stop_profit item.
Asynchronous write: a successful response only means the request was accepted
and forwarded. The take-profit / stop-loss is persisted onto the order record
asynchronously — poll GET /futuresGrid/order and read lossStop / profitStop
(and related fields) to confirm the update took effect.
Restrictions (return result=false with the message shown):
Message | Cause |
|
|
|
|
|
|
|
|
|
|
|
|
| The order forbids changing take-profit / stop-loss |
| Order is closing/unlocking/canceled |
| Bonus-funded orders cannot set a stop-loss |
Examples — request bodies for common combinations:
Set a stop-loss at a fixed price:
{
"bu_order_id": "1234567890",
"list": [
{ "type": "stop_loss", "stop_type": "price", "value": "70000" }
]
}Set a take-profit at a fixed price:
{
"bu_order_id": "1234567890",
"list": [
{ "type": "stop_profit", "stop_type": "price", "value": "150000" }
]
}Set both take-profit and stop-loss in one call:
{
"bu_order_id": "1234567890",
"list": [
{ "type": "stop_loss", "stop_type": "price", "value": "70000" },
{ "type": "stop_profit", "stop_type": "price", "value": "150000" }
]
}Stop-loss by loss ratio (−20%) and take-profit by profit ratio (+50%):
{
"bu_order_id": "1234567890",
"list": [
{ "type": "stop_loss", "stop_type": "profit_ratio", "value": "-0.2" },
{ "type": "stop_profit", "stop_type": "profit_ratio", "value": "0.5" }
]
}Take-profit by profit amount, settled to USDT:
{
"bu_order_id": "1234567890",
"list": [
{ "type": "stop_profit", "stop_type": "profit_amount", "value": "500", "profit_stop_sell_model": "TO_USDT" }
]
}Take-profit as a limit order (place a limit at 149000 when 150000 is hit), with a 30s trigger delay:
{
"bu_order_id": "1234567890",
"list": [
{ "type": "stop_profit", "stop_type": "price_limit", "value": "150000", "limit_price": "149000", "stop_delay": 30 }
]
}Neutral grid (no_trend) — lower and upper stop-loss prices:
{
"bu_order_id": "1234567890",
"list": [
{ "type": "stop_loss", "stop_type": "price", "value": "70000", "stop_high_price": "160000" }
]
}Clear a previously set stop-loss (empty value):
{
"bu_order_id": "1234567890",
"list": [
{ "type": "stop_loss", "stop_type": "price", "value": "" }
]
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list | Yes | One item per trigger to configure. May include a `stop_loss` item, a `stop_profit` item, or both. | |
| bu_order_id | Yes | Bot order ID |