Skip to main content
The cancelTpSl action cancels all TP/SL trigger orders associated with a specific position, identified by contract ID and position side. This is the fastest way to remove all trigger orders for a position without having to look up and cancel individual order IDs. This action is idempotent: if there are no active TP/SL orders for the specified position, the request succeeds and returns cancelledCount: 0 rather than an error.

Endpoint

Request

All requests must include an ECDSA signature and a millisecond-precision nonce.

Action fields

string
required
Fixed value: "cancelTpSl".
int32
required
The contract ID whose TP/SL orders you want to cancel.
int8
Scopes the cancellation by position side: 0 = cancel all TP/SL orders for the entire contract, 1 = cancel LONG position TP/SL only, 2 = cancel SHORT position TP/SL only. Defaults to 0.

Response

Response fields

int
The number of TP/SL trigger orders that were cancelled. A value of 0 means no orders were found for the specified position — this is not an error condition.
To cancel a single specific TP or SL order by its ID, use cancelConditional instead.