Binance Futures trailing stop: ts= and cbr=
On most exchanges ts=1% means "trail the price by 1%". On Binance Futures and Binance Delivery it means something else. There, ts= sets the price where the trailing stop switches on, and a second key, cbr=, sets how far it trails. If you copy a trailing stop alert from Binance spot or another exchange, you get an order that trails by Binance's minimum instead of the distance you meant.
This page comes from the Autoview integrations code that runs on our servers today. We read the code; we did not send these orders live for this guide. The venue rules quoted below come from Binance's own API docs.
The two keys
| Key | What Autoview sends to Binance | If you leave it out |
|---|---|---|
ts= or fts= | The activation price of a TRAILING_STOP_MARKET order | No trailing stop |
cbr= | The callback rate, passed through as the number you write | 0.1 |
Any line with ts= or fts= goes out as a TRAILING_STOP_MARKET order. That holds for Binance Futures (e=binancefutures), Binance Delivery (e=binancedelivery) and the testnet versions of both.
ts= is where the trail starts
ts= is measured from the current price. ts=1% puts the activation price 1% above it, and ts=-1% puts it 1% below. A plain number is added the same way, so ts=-200 on BTCUSDT is 200 USDT below. fts= is an exact price, for example fts=70000.
Which side of the book counts as "the current price" depends on b= and t=. b=buy or b=long with the default limit type, or b=sell or b=short with t=market, is measured from the bid. The other two cases use the ask. On a c=position line with ps=position, the reference is the position's entry price.
Binance's API docs set one rule on the activation price: for a sell, it must be above the latest price, and for a buy, below it. Otherwise Binance rejects the order with "Order would immediately trigger". So:
- To trail out of a long, the order is a sell. Use a positive
ts=, such asts=1%. - To trail out of a short, the order is a buy. Use a negative
ts=, such asts=-1%.
cbr= is how far it trails
cbr= is the callback rate. Autoview sends the number to Binance unchanged as callbackRate. Binance's docs give its range as 0.1 to 20. Leave cbr= off and Autoview sends 0.1, the lowest value in that range.
Write cbr= as a bare number: cbr=1 or cbr=0.5. Autoview reads it as a plain number, so cbr=1% cannot be read and quietly becomes 0.1. The same happens with cbr=0.
Trailing out of an open position
The cleanest way to trail an exit is a c=position line. Autoview sizes the order from the position you hold, sends it on the side that closes it, and marks it reduce-only when the account is in one-way mode.
e=binancefutures s=BTCUSDT c=position b=long t=market ts=1% cbr=1 d=1That line finds your BTCUSDT long and sends a sell trailing stop for the whole position. It activates 1% above the ask and then trails at a callback rate of 1. For a short, flip both signs:
e=binancefutures s=BTCUSDT c=position b=short t=market ts=-1% cbr=1 d=1On Binance Delivery the line is the same with the coin-margined symbol:
e=binancedelivery s=BTCUSD_PERP c=position b=long t=market ts=1% cbr=1 d=1We use t=market in these examples on purpose. With the default limit type, Autoview also attaches a limit price to the order. A trailing stop has no use for one, so leave it out.
Things that catch people out
- One order per line. If a line has
sl=ortp=as well asts=, the trailing stop sets the order type and you get one trailing order, not a stop and a trail. Put the stop loss on its own line. - Side on a plain entry line. Without
c=position, a line withts=goes out on the side you wrote inb=. Unlikesl=andtp=, it is not flipped for you. In one-way mode, addro=1so it can only reduce a position, or usec=positionas above. - Trigger source.
pxs=sets which price Binance watches. See trigger price source by exchange. - No limit trailing. The order is always
TRAILING_STOP_MARKET.t=ioc,t=fokandt=posthave no effect on it.
Binance spot works differently
On Binance spot, ts= really is the trail distance. Autoview sends it as a trailing delta in basis points, and there is no cbr=. The Binance spot command reference covers that version. For how other exchanges handle a trailing stop, see trailing stops by exchange.
Test it before you rely on it
Keep d=1 on the line and send it. Autoview writes the order it would place to your log, with the activation price and callback rate, and sends nothing. The log guide shows where to look. To see the order on Binance without real money, run the same line on the Binance Futures testnet.