Bybit perpetual DCA entry with a trailing stop
This is a worked command template, not a general reference: one Bybit perpetual strategy shape, built entirely from parameters already verified against Autoview's own execution code. It assumes you know the basic shape of an Autoview command. If you don't, start with the command reference, then come back. For every parameter on this page in full depth, see the Bybit perpetuals command reference and stops, targets, and trailing stops.
What this template does
A dollar-cost-averaged, or DCA-style, entry does not place one order at one price. It splits the entry across several price levels, so if the market dips before it turns, the position builds at a better average price than a single order would have gotten. This template stages three limit buys below the current price, sized larger the further they sit from it, then arms a trailing stop on the last rung so a favorable move afterward locks in gains without a fixed take-profit target capping the upside.
One alert produces all three orders. Autoview reads newline-separated lines in a single alert message as separate commands executed in sequence, so the whole ladder fires from one TradingView alert.
The alert message
Paste this into the alert's Message box, exactly as you would for a single-line command. Three lines, one per rung:
e=BYBIT s=BTCUSDT b=buy t=limit p=-0.5% q=100 u=currency l=3
e=BYBIT s=BTCUSDT b=buy t=limit p=-1.5% q=150 u=currency
e=BYBIT s=BTCUSDT b=buy t=limit p=-3% q=250 u=currency ts=2% tsx=1%Change the symbol, the price offsets, and the sizes to fit your own setup. The shape is what matters: rungs getting bigger as they get further from the current price, and the trailing stop only on the final rung.
Rung by rung
| Rung | Command | What it does |
|---|---|---|
| 1 (closest) | p=-0.5% q=100 u=currency l=3 | A limit buy resting half a percent below the price when the alert fires, sized to commit about 100 USDT notional. l=3 sets 3x leverage on the position; Bybit applies leverage through a separate call, so it governs the whole position rather than just this order, and only needs to be set once. |
| 2 (middle) | p=-1.5% q=150 u=currency | A second limit buy 1.5% below the reference price, sized larger than rung 1 at 150 USDT notional, so if price keeps falling the average entry improves. |
| 3 (deepest) | p=-3% q=250 u=currency ts=2% tsx=1% | The furthest rung, 3% below the reference price, sized largest at 250 USDT notional, carrying the trailing stop. |
p= is a percentage offset from the price Autoview reads when each command executes, not from the price of an earlier rung, so all three offsets are measured from roughly the same starting point since the alert fires them together. u=currency reads q= as a notional amount in USDT rather than a coin quantity, which keeps the sizing readable regardless of BTC's price. See the full reference for q='s other two forms, a plain coin amount or a percent of balance.
The trailing stop
ts=2% sets a trailing stop that follows the position by 2%, once armed. tsx=1% is the activation price: the trail does not start tracking until price is 1% above the reference price the alert read when it fired. Put together, the deepest rung does not just buy the dip, it also arms a stop that waits for the market to move a percent in your favor before it starts following, then trails 2% behind the best price seen from there.
The trailing stop sits on one rung, not all three. Bybit's trailing stop is a property of the position, not of an individual resting order, so putting ts=/tsx= on every rung would mean each fill tries to (re)set the same position-level value rather than adding three separate trailing stops. This template arms it once, on the rung most likely to fill last, so it is in place once the ladder has done most of its work. Confirm this is the behavior you want with d=1 and a demo account before trading it live.
Test before you go live
Append d=1 to the whole alert and Autoview parses every line, reports what each would have done, and places nothing:
e=BYBIT s=BTCUSDT b=buy t=limit p=-0.5% q=100 u=currency l=3 d=1
e=BYBIT s=BTCUSDT b=buy t=limit p=-1.5% q=150 u=currency d=1
e=BYBIT s=BTCUSDT b=buy t=limit p=-3% q=250 u=currency ts=2% tsx=1% d=1Read the log for all three lines. Confirm the symbol, side, price, and size on each rung are what you meant, and that the trailing-stop rung resolved the way this page describes.
This exact combination has not been placed as a live or testnet order. Every parameter here traces to Autoview's verified command-syntax reference and matches shapes already confirmed live on the Bybit cheat sheet and the full Bybit reference, but a multi-rung ladder with a trailing stop on the last leg is a new combination, not one this page's author placed on a live Bybit account. Dry-run it, then run the whole ladder on a Bybit testnet connection before you trust it with real size.
Adjust it for your own setup
- Fewer or more rungs. Three is a starting point, not a rule. Add a line for a fourth rung, or drop to two, following the same pattern: symbol, side, price offset, size, and the trailing stop only on the last one.
- Shorting instead of longing. Flip
b=buytob=selland the price offsets to positive, so each rung sits above the current price instead of below it. - A fixed take-profit instead of a trailing stop. Swap
ts=/tsx=on the last rung fortp=, a fixed target instead of one that follows price. Both are covered on the stops, targets, and trailing stops guide. - A different exchange. The ladder pattern, multiple limit orders in one alert, works anywhere Autoview supports limit orders. The trailing-stop parameters are Bybit-specific in the exact form used here; check the cross-exchange command reference before you port this to another venue.