Cancel only stop-loss, take-profit or trailing orders (sl=, tp=, ts=), by exchange
You want to pull the trailing stop and put a fixed stop in its place, without touching your take-profit. On some exchanges you can say which kind of order to cancel:
c=order ts=1On a cancel line, sl=, tp= and ts= place nothing. Where the exchange reads them, they narrow which orders go. Where it does not, they are ignored and the line cancels every matching order, entries and take-profits included. This page comes from the Autoview integrations code that runs on our servers today. We read the code; we did not run each exchange live for this guide. Test your own line with d=1 before you rely on it.
Exchanges that read all three
- Kraken.
sl=keeps only stop-loss orders,tp=only take-profit orders,ts=orfts=only trailing stops. Any value counts,0included. - OANDA.
sl=keeps only stop-loss orders,tp=only take-profit orders,ts=only trailing stop-loss orders. Any value counts.fts=is not read. - BitMEX reads them the other way round when the value is 0.
sl=0keeps your stop-losses and cancels the rest;sl=with any other value cancels only stop-losses.tp=andts=work the same way for take-profit (if-touched) orders and trailing stops.
Exchanges that read some of them
- Bitfinex.
ts=orfts=keeps only trailing stops, andsl=keeps only stop orders.tp=is not read. - Deribit, Kraken Futures and Charles Schwab.
ts=orfts=keeps only trailing stops.sl=andtp=are not read. - Gate.io futures.
ts=orfts=cancels only trailing orders and leaves your open and trigger orders alone. - OKX.
ts=orfts=cancels only trailing (move order stop) orders. Plain orders and other stops are skipped.
Bitget futures: ts= cancels nothing
From our reading of the code, adding ts= to a Bitget futures cancel drops every order from the list, so nothing is cancelled. This holds on both of the API paths Autoview uses for Bitget. We have not run it live. Until that changes, narrow a Bitget cancel with t=open or t=close or by id=, and test with d=1.
Every other exchange ignores them
On the rest, c=order sl=1, c=order tp=1 and c=order ts=1 behave like plain c=order: every open order that matches the rest of the line is cancelled. That includes Binance, Bybit, Coinbase Advanced, KuCoin, Tradovate, TradeStation and Hyperliquid. To keep one kind of order there, use a filter your exchange reads, such as t=, b= or id=.
Two things to watch
- The value rarely matters, except on BitMEX. Kraken, OANDA and Bitfinex treat
sl=0the same assl=5. Copying a BitMEX line to another exchange can flip its meaning. - These filters stack with the others. On Kraken,
b=sellonly matches orders without leverage, soc=order b=sell ts=1cancels unleveraged sell-side trailing stops. For the trailing stop on a margin long, sendc=order b=short ts=1(on a margin short,b=long). See where b= also picks spot or margin. Check each filter for your venue first.
Test it once before you rely on it
Add d=1 to your cancel line. Autoview lists each order it would cancel in your log and cancels nothing. The log guide shows where to look. For how these orders are placed in the first place, see stop loss, take profit and trailing stop and trailing stops by exchange.