Stop loss, take profit, and trailing stop
By the end of this guide you can add sl=, tp=, or ts= to an Autoview alert on any exchange Autoview supports, and read back the response to confirm what actually landed. These are the three parameters traders reach for most. Whether the venue honors the field as a native attached order, a standalone trigger, or ignores it silently varies by exchange (covered venue by venue below), so treat "I added the parameter" and "the exchange is protecting my position" as two separate things to verify, not one.
Autoview reads each alert as a string of space-separated key=value pairs. The protective parameters are sl (stop loss), tp (take profit), and ts (trailing stop). You write a percentage or a price, and Autoview hands the resulting order to your exchange to rest alongside your position.
What you need first
You need a working alert that already opens a position. If you have never sent one, build the entry alert first and confirm it fires. A protective order needs something to protect.
- An exchange connected in Autoview. Forex through OANDA, futures through Tradovate, stocks through Alpaca, or any of more than a dozen crypto venues.
- An alert sender. TradingView is the common one, but the webhook endpoint accepts a POST from anything that can send HTTP: a script, a bot, your own server. (Wondering whether this is TradingView's own API doing the work? It isn't. See does TradingView have an API? for how the two actually fit together.)
- An entry that works. Send it once on a demo or testnet connection and watch it fill.
The three parameters
On a webhook, the exchange is whichever account the webhook is linked to, so the command doesn't name it. On the Chrome extension, add e= (for example e=oanda) to pick the exchange.
Stop loss: sl
A stop loss closes the position to cap a loss. Write it as a move from the current price, either a percentage (sl=-1%) or a price amount (sl=-0.0050), or use fsl= for an absolute price. A long position stops out below entry, so the percentage is negative:
s=EUR_USD b=long q=1000 sl=-1%
On OANDA specifically, that example needs one more thing: sl only attaches when it's sent inside the & advanced-syntax bracket, e.g. & sl=-1%. Sent without &, as written above, OANDA fills the order anyway and silently drops the stop, no error, no warning. See the OANDA command reference for the full rule.
That rests the stop one percent under the price at the time the alert lands.
Crypto.com works differently. Autoview does not read sl=, tp=, or ts= there, so the entry fills with no stop attached. On Crypto.com, place the stop as its own order with px= or fpx= instead. The Crypto.com command reference has the syntax.
Want an absolute price instead of a percentage? Use the fixed form: fsl=1.0820. A plain number in sl= is an offset from the price, not a price. If your alert comes from TradingView you can let it fill the number for you, for example fsl={{close}}. Note that {{close}} is a TradingView placeholder, not Autoview syntax. TradingView swaps in the candle's close when it fires the alert. Autoview only sees the value that arrives. A script or another platform supplies that number its own way, so the alert sender owns it, not us.
Take profit: tp
A take profit closes the position once it moves in your favor by the amount you name. For a long, that target sits above entry:
s=EUR_USD b=long q=1000 tp=2%
Same OANDA caveat applies here: tp only attaches inside the & advanced-syntax bracket. Sent bare, as above, the order fills with no take-profit attached and no error.
Stops and targets are not mutually exclusive. Send a stop loss and a take profit on the same position and whichever the market reaches first does the closing.
Trailing stop: ts
A trailing stop follows the price as it moves your way and only closes when it reverses by the distance you set. Lock in a run without naming a fixed exit. The value is the trailing distance:
s=EUR_USD b=long q=1000 ts=1%
Same OANDA caveat: ts only attaches inside the & advanced-syntax bracket. Sent bare, as above, the order fills unprotected with no error. This requirement is specific to OANDA. Most other exchanges attach these parameters without the bracket, and Crypto.com does not attach them at all.
Price climbs, the stop climbs with it. Price drops one percent off its high, you are out. The floor ratchets up; it never ratchets down.
A second level: slx, tpx, and tsx
On most venues sl, tp, and ts are enough. The value you write is the level the protective order works off, and Autoview hands it to the exchange to rest beside your position. Each one also takes an optional second level, and what that second level does depends on the parameter:
- slx and tpx turn the stop or take profit into a stop-limit order. The
sl(ortp) value stays the trigger;slx(ortpx) is the limit price the resulting order rests at once that trigger fires. Without it you get a stop-market that fills at whatever's available; with it you cap the fill price and accept that a fast move can leave it unfilled. - tsx is an activation price. The trailing stop doesn't begin tracking until price first reaches
tsx, then it trails by yourtsdistance from there.
A stop-limit on a long: trigger at minus one percent, then rest a limit a touch below so it still has room to fill. Bybit is one venue that supports this:
s=BTCUSDT b=long q=0.01 sl=-1% slx=-1.2%
Support for the second level differs by venue, and so does exactly what it means. Some exchanges accept a stop-limit, some only a stop-market and ignore the extra level, and the OANDA integration ignores slx/tpx/tsx entirely. Send it once on a demo or testnet connection and read the log to see what your venue actually did with it.
Symbol format matters
Each exchange names its instruments its own way, and Autoview passes the symbol through. OANDA uses an underscore: EUR_USD, not EURUSD. Get this wrong and the alert is rejected before any stop logic runs. Check the format in OANDA's own instrument list when you are unsure, and confirm the venue's symbol convention before you trust a stop to it.
Verify the order landed
Do not assume. After you fire the alert, confirm three things.
- Open the Autoview log and read the response for that alert. A rejected symbol or an unsupported order type shows up here first.
- Open the position on the exchange itself and look for the resting stop or target order. If Autoview reported success, the order is on the exchange, not held by us.
- Nudge it on a demo or testnet connection. Push the price toward the trigger and watch it fire. Cheap rehearsal beats a surprise in live size.
Common snags
- Wrong sign. A long stop loss is negative (
sl=-1%); a long take profit is positive (tp=2%). Flip them for a short. - Unsupported stop variant. Not every exchange accepts every stop. A few reject a separate
slxtrigger, or a trailing stop, and the log says so. Drop back to a plainslortpand read what the venue actually allows. - Symbol rejected. Almost always a format mismatch: the underscore on OANDA, or a contract code that does not exist on that venue.
- Nothing on the exchange. If the Autoview log shows success but no order rests on the venue, you are reading stale data on the exchange side. Refresh and look again.
Autoview only forwards the order. Your exchange decides whether to accept it and how to fill it. When in doubt, the exchange's own order ticket is the source of truth, and our log tells you what we sent.