Stop loss, take profit, and trailing stop

Autoview · Guide

By the end of this guide you can attach a stop loss, a take profit, or a trailing stop to any Autoview alert, and read back the response to confirm it landed. These are the three parameters traders reach for most. They turn a one-shot entry into a position that protects itself.

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 one of 20+ 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.
  • An entry that works. Send it once on a demo or testnet connection and watch it fill.

The three parameters

Stop loss: sl

A stop loss closes the position to cap a loss. Write it as a percentage move from the current price, or as an absolute price. A long position stops out below entry, so the percentage is negative:

a=local e=oanda s=EUR_USD b=long q=1000 sl=-1%

That rests the stop one percent under the price at the time the alert lands. Crypto example, same shape:

a=local e=cryptocom s=BTC_USDT b=long q=0.01 sl=-2%

Want an absolute price instead of a percentage? Drop one in: sl=1.0820. If your alert comes from TradingView you can let it fill the number for you, for example sl={{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:

a=local e=oanda s=EUR_USD b=long q=1000 tp=2%

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:

a=local e=oanda s=EUR_USD b=long q=1000 ts=1%

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 (or tp) value stays the trigger; slx (or tpx) 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 your ts distance 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:

a=local e=bybit 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.

  1. Open the Autoview log and read the response for that alert. A rejected symbol or an unsupported order type shows up here first.
  2. 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.
  3. 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 slx trigger, or a trailing stop, and the log says so. Drop back to a plain sl or tp and 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.

See supported exchanges