Closing LuxAlgo trades: exit, take profit, and stop loss alerts

Autoview · Guide · Updated October 5, 2026

Getting into a trade on a LuxAlgo signal is the easy half, and the Using Autoview with LuxAlgo guide covers it. This page is the other half: what closes the trade. Signals & Overlays gives you three kinds of exit information, and each one maps to a different Autoview command.

  • Exit crosses. The blue and orange crosses in the Confirmation + Exits and Contrarian + Exits signal modes.
  • Take profit and stop loss hits. Price reaching one of the levels drawn by the TP/SL Points feature.
  • The levels themselves. The current take profit and stop loss prices, which you can hand to the exchange when you enter.

Everything below is plain Autoview syntax from the command reference. LuxAlgo decides when an alert fires. The command in the alert decides what Autoview does.

The quick map

LuxAlgo alertWhere you find itAutoview command
Bullish Exit or Bearish ExitThe regular alert condition lists=BTCUSDT c=position, or s=BTCUSDT c=position q=50% for half
Take Profit or Stop LossOnly under "Any alert() function call"s=BTCUSDT c=position, written in LuxAlgo's own message field
TP/SL levels at entryPlot placeholders in the entry alert's messagefsl={{plot("Stop Loss")}} ftp={{plot("Take Profit")}} on the entry command

Swap BTCUSDT for your own symbol, spelled the way your exchange spells it.

Exit crosses: close on Bullish Exit and Bearish Exit

LuxAlgo's signal modes page describes the exits as colored crosses: a bullish exit is a blue cross, a bearish exit is an orange cross. They mark places to consider leaving a position opened on an earlier confirmation signal. Both have their own entries in the Signals & Overlays alert list, Bullish Exit and Bearish Exit, so you can create a normal TradingView alert on each one.

The message for an exit alert is a close command:

s=BTCUSDT c=position

c=position tells Autoview to close the open position on that symbol instead of opening a new one. It needs no b=, because a close works out the offsetting side from the position itself. Put it in the alert's Message box, turn on Webhook URL in the Notifications tab, paste your Autoview webhook URL, and save.

Before you wire both crosses, scroll back through your own chart and check which cross follows which of your entries. If you only trade longs, you probably want one exit alert, not two. An exit alert that fires while you hold the opposite position will close that position too, since c=position closes whatever is open on the symbol.

Partial exits on successive crosses

LuxAlgo notes that during a longer trend, Confirmation exits can repeat, and that you can take partial exits instead of closing everything on the first one. Autoview handles that with q= on the close:

s=BTCUSDT c=position q=50%

On a close, q= is a share of the position you hold, not of your balance. Each cross closes half of whatever is still open: the first takes half, the second takes half of the rest, and so on. LuxAlgo also says successive exits don't happen in Contrarian mode, so if you trade Contrarian signals, expect one exit per trade and size the close for that.

Take profit and stop loss hits: the any alert() route

The TP/SL Points feature draws take profit and stop loss levels on your chart. Per LuxAlgo's TP/SL page, it recalculates them from whatever you pick in the "TP/SL Levels" menu (new signals, the Smart Trail turning, and so on) and moves them when price runs far enough away.

Here's the catch. Take Profit and Stop Loss are not in the regular alert list. They only exist as conditions inside LuxAlgo's "Any alert() function call" alert, and that alert takes its message from a different place. Set it up like this:

  • Open the indicator settings and scroll to the ANY ALERT() FUNCTION CALL CONDITIONS section.
  • Toggle on Take Profit, Stop Loss, or both. Leave the entry conditions off.
  • In the message field below the list of conditions, write the close command: s=BTCUSDT c=position.
  • Create a new alert, pick the LuxAlgo indicator in the first Condition menu and Any alert() function call in the second, turn on Webhook URL, and paste your Autoview webhook URL.

LuxAlgo's alerts page places the custom message for this alert in the indicator settings, so that field is where the Autoview command lives.

LuxAlgo's docs say an any alert() alert keeps the indicator settings it was created with. So if you also use any alert() for entries, create the exit alert with only the exit conditions on, then change the toggles and message and create the entry alert separately. Each alert holds its own message.

Or hand the levels to the exchange when you enter

An alert-driven close can only act once the alert fires and reaches Autoview. LuxAlgo's any alert() alerts default to once per bar close, and its signals confirm at the open of the next candle. A stop that already sits on the exchange doesn't wait for any of that.

LuxAlgo exposes its current levels as plot placeholders: {{plot("Take Profit")}} for the nearest take profit and {{plot("Stop Loss")}} for the nearest stop loss. TradingView fills these with prices when the alert fires, and Autoview's fixed-price parameters take an absolute price, so you can put both on the entry command:

s=BTCUSDT b=long q=2% fsl={{plot("Stop Loss")}} ftp={{plot("Take Profit")}}

Two things to check before relying on this. First, LuxAlgo calls these the nearest levels, read at the moment the alert fires. That may not be the pair of levels you had in mind, and the dry run below shows the exact prices that arrived. Second, not every exchange accepts a take profit and a stop loss on the same order that opens the position. The stop loss, take profit, and trailing stop guide covers how each venue handles it.

If you'd rather not depend on LuxAlgo's levels at all, a percentage stop on the entry does the same job: sl=-1.5% for a long, sl=1.5% for a short. A sensible mix is an exchange stop as the floor and exit-cross alerts for taking profit.

Spot pairs work differently

c=position is for margin and futures positions. On a spot pair, what you hold is a coin balance, not a position, so c=position finds nothing to close. To exit a spot holding, send a sell command instead. The spot cheat sheets for Kraken, Bybit, and Crypto.com show the sell form.

Dry-run every exit before it goes live

Add d=1 to each exit command first:

s=BTCUSDT c=position q=50% d=1

Autoview reads the alert and logs what it would have done without sending anything to the exchange. Wait for a cross or a TP/SL hit, then check the Autoview event log for the symbol, the close, and the size. For the entry version with plot placeholders, compare the logged stop and take profit prices with the levels on your chart. When they match, remove d=1. A demo or testnet connection is the other safe place to watch it work before real money.

What this doesn't do

LuxAlgo's exits and levels are technical analysis, and an exit cross is a place to consider leaving, not a promise of profit. Autoview doesn't judge whether an exit is a good one. It closes, or partly closes, what the alert tells it to. Trading carries risk of loss, and you're responsible for the signals and settings you automate. See our disclosures.

Set up LuxAlgo entries first