Protection and exits
Stops, take-profits (including staged legs), breakeven, trailing stops and ratchets.
set_protection
Set stop_loss, take_profit, breakeven, trailing and R-ratchet on a position in one call. A stop is never widened unless allow_widen:true and never removed unless allow_remove:true. The response states native vs worker protection for each leg. dry_run defaults to true: nothing is sent to the exchange until dry_run:false is passed explicitly. Responses on a simulated connection carry mode:"simulated". Requires the trade capability (Pro and above; simulated connections may trade on every tier).
Changes your exchange account or platform state. It previews by default: pass dry_run: false to execute. Paper mode forces a preview.
Capability: trade · mutating · REST: POST /v1/tools/set_protection
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
position_uid | string | yes | — | |
stop_loss | number | no | — | |
take_profit | number | no | — | |
breakeven | object | no | — | |
trailing | object | no | — | |
ratchet | object | no | — | |
take_profit_legs | object[] | no | — | |
allow_widen | boolean | no | — | |
allow_remove | boolean | no | — | |
lease_token | string | no | — | |
expect_stop_loss | number | no | — | |
expect_take_profit | number | no | — | |
expect_amount_base | number | no | — | |
expect_tolerance | number | no | — | |
dry_run | boolean | yes | true | Default true: validate and preview only. Set false to execute. |
Example request:
{
"position_uid": "<position_uid>",
"dry_run": true
}modify_position
Alias of set_protection for stop_loss/take_profit only. Never widens a stop unless allow_widen:true. Accepts lease_token and expect_stop_loss/expect_take_profit/expect_amount_base (PRECONDITION_FAILED when the position changed). dry_run defaults to true: nothing is sent to the exchange until dry_run:false is passed explicitly. Requires the trade capability (Pro and above; simulated connections may trade on every tier).
Changes your exchange account or platform state. It previews by default: pass dry_run: false to execute. Paper mode forces a preview.
Capability: trade · mutating · REST: POST /v1/tools/modify_position
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
position_uid | string | yes | — | |
stop_loss | number | no | — | |
take_profit | number | no | — | |
allow_widen | boolean | no | — | |
lease_token | string | no | — | |
expect_stop_loss | number | no | — | |
expect_take_profit | number | no | — | |
expect_amount_base | number | no | — | |
expect_tolerance | number | no | — | |
dry_run | boolean | yes | true | Default true: validate and preview only. Set false to execute. |
Example request:
{
"position_uid": "<position_uid>",
"dry_run": true
}set_breakeven
Alias of set_protection{breakeven}: move the stop to entry (plus buffer_bps) once the position is in profit; POSITION_NOT_IN_PROFIT otherwise. Accepts lease_token and expect_stop_loss/expect_take_profit/expect_amount_base (PRECONDITION_FAILED when the position changed). dry_run defaults to true: nothing is sent to the exchange until dry_run:false is passed explicitly. Requires the trade capability (Pro and above; simulated connections may trade on every tier).
Changes your exchange account or platform state. It previews by default: pass dry_run: false to execute. Paper mode forces a preview.
Capability: trade · mutating · REST: POST /v1/tools/set_breakeven
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
position_uid | string | yes | — | |
buffer_bps | number | no | 0 | |
lease_token | string | no | — | |
expect_stop_loss | number | no | — | |
expect_take_profit | number | no | — | |
expect_amount_base | number | no | — | |
expect_tolerance | number | no | — | |
dry_run | boolean | yes | true | Default true: validate and preview only. Set false to execute. |
Example request:
{
"position_uid": "<position_uid>",
"dry_run": true
}set_trailing_stop
Alias of set_protection{trailing}. State persists across restarts (native trailing where the exchange supports it, otherwise a server-side worker). Accepts lease_token and expect_stop_loss/expect_take_profit/expect_amount_base (PRECONDITION_FAILED when the position changed). dry_run defaults to true: nothing is sent to the exchange until dry_run:false is passed explicitly. Requires the trade capability (Pro and above; simulated connections may trade on every tier).
Changes your exchange account or platform state. It previews by default: pass dry_run: false to execute. Paper mode forces a preview.
Capability: trade · mutating · REST: POST /v1/tools/set_trailing_stop
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
position_uid | string | yes | — | |
percent | number | no | — | |
distance_price | number | no | — | |
activation_price | number | no | — | |
off | true | no | — | |
lease_token | string | no | — | |
expect_stop_loss | number | no | — | |
expect_take_profit | number | no | — | |
expect_amount_base | number | no | — | |
expect_tolerance | number | no | — | |
dry_run | boolean | yes | true | Default true: validate and preview only. Set false to execute. |
Example request:
{
"position_uid": "<position_uid>",
"dry_run": true
}get_trailing_status
Trailing stops on this connection (or one position_uid): configuration, mode native|worker, activation, and the current stop. order:"newest_first". Available on every tier.
Capability: read · read-only · REST: POST /v1/tools/get_trailing_status
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
position_uid | string | no | — |
Example request:
{}cancel_trailing_stop
Retire the server's trailing stop on a position; the current stop stays where it is. Alias of set_protection{trailing:{off:true}}. Accepts lease_token and expect_stop_loss/expect_take_profit/expect_amount_base (PRECONDITION_FAILED when the position changed). dry_run defaults to true: nothing is sent to the exchange until dry_run:false is passed explicitly. Requires the trade capability (Pro and above; simulated connections may trade on every tier).
Changes your exchange account or platform state. It previews by default: pass dry_run: false to execute. Paper mode forces a preview.
Capability: trade · mutating · REST: POST /v1/tools/cancel_trailing_stop
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
position_uid | string | yes | — | |
lease_token | string | no | — | |
expect_stop_loss | number | no | — | |
expect_take_profit | number | no | — | |
expect_amount_base | number | no | — | |
expect_tolerance | number | no | — | |
dry_run | boolean | yes | true | Default true: validate and preview only. Set false to execute. |
Example request:
{
"position_uid": "<position_uid>",
"dry_run": true
}