Exit Management Techniques
Three ways to get out of a trade: ATM strategies, payload brackets, and TradingView-managed exits.
Getting into a trade is straightforward — it's a PLACE command with a BUY or SELL action. Getting out of a trade is where the complexity lives. You have three fundamentally different approaches, and choosing the wrong one for your situation is one of the most common sources of confusion in the Discord help channel.
This guide covers when to use each approach, how to set it up, and what goes wrong when you mix them without understanding the interactions.
The Three Approaches
1. ATM Strategy Templates
An ATM (Advanced Trade Management) strategy is a template saved in NinjaTrader that defines your stop loss, profit target, and optional advanced rules (trailing stops, breakeven moves, etc.). When you reference an ATM in your alert, NinjaTrader applies the template to the order and manages the exit entirely on the NT8 side.
Best for: Fixed bracket levels that don't change trade-to-trade. Traders who want NT8 to manage exit logic with no further webhook involvement. Multi-bracket setups (multiple targets with different quantities).
Limitations: TP/SL levels are defined in advance inside the template. You can't dynamically change them per-trade from the alert payload. The contract quantity in the alert must exactly match the ATM template's quantity or NT8 silently fails.
2. Payload Brackets (take_profit / stop_loss)
You include take_profit= and/or stop_loss= directly in the alert payload. CrossTrade creates the corresponding opposing orders alongside your entry. These can be absolute prices, tick offsets, percentage offsets, or dollar values.
Best for: Dynamic TP/SL levels that change per trade (using TradingView variables like {{close}}). Traders who want all trade logic defined in the alert payload. Simple one-target, one-stop setups.
Limitations: Creates independent limit and stop orders — they're not grouped under an ATM strategy in NT8 unless you use append_atm=true;. If you close the position manually, these bracket orders remain active (orphaned) unless you also cancel them.
3. TradingView-Managed Exits
Your TradingView strategy or indicator generates both entry and exit signals, and CrossTrade passes both through to NinjaTrader. The exit happens when TV fires the exit alert, not based on price levels defined in NT8.
Best for: Strategies with complex exit logic that can't be reduced to a simple TP/SL level (indicator-based exits, time-based exits, signal-based exits). Full Strategy Sync setups where TV controls the entire position lifecycle.
Limitations: Relies on TradingView delivering the exit alert promptly. Alert delays mean your exit is delayed. No protection if TV goes down or misses the signal — you'd need a backup (NAM loss limits, manual monitoring).
Decision Tree
Ask yourself these questions in order:
Are your TP/SL levels fixed (same every trade)? → Yes: Use an ATM template. It's the simplest setup and NT8 handles everything after entry. → No: Continue below.
Do your TP/SL levels change per trade but are known at entry time? → Yes: Use payload brackets with tick, percentage, or variable-based values. → No: Continue below.
Does your exit depend on a future signal or condition that isn't known at entry time? → Yes: Use TradingView-managed exits with Strategy Sync (for strategies) or separate exit alerts (for indicators).
Do you want NT8 to handle a protective stop while TV handles the profit target (or vice versa)? → Yes: This is a hybrid approach. Use strategy_exit_block=true; with an ATM for the protective side, and let TV handle the other. See the Hybrid section below.
ATM Strategy Setup
Creating the Template
In NinjaTrader, open the Chart Trader or SuperDOM. Select <Custom> from the ATM Strategy dropdown. Set your stop loss and profit target levels, then click Save As and give it a name (e.g., "50-Tick-Scalp"). This template is now available for any future order.
For a detailed walkthrough with multi-target setups and trailing stops, see the Creating ATM Template docs.
Referencing the Template in Your Alert
strategy=50-Tick-Scalp; must exactly match the template name in NT8. Case-sensitive, spaces and all.
qty=2; must match the total contract quantity the ATM template is configured for. If the ATM has 2 targets with 1 contract each (total: 2), your alert must send qty=2. If they don't match, NT8 will either open a partial position using only the innermost bracket, or silently fail entirely. There's no error message. This is an NT8 behavior, not a CrossTrade limitation — but it's the #1 source of "my ATM isn't working" support tickets.
flatten_first=true; closes any existing position AND cancels any pending bracket orders before placing the new entry. This prevents orphaned stops and targets from the previous trade lingering in the account. Always use flatten_first with ATMs.
ATM with Strategy Sync
If you're running a TradingView strategy with sync and want NT8 to manage exits via ATM:
strategy_exit_block=true; blocks the TV strategy's exit signals from reaching NT8. Since the ATM handles the exit, you don't want TV also trying to close the position. Without this, you'll get conflicts between the ATM and the strategy exits.
What happens when the ATM closes the position: TV doesn't know the ATM hit TP or SL. The strategy will eventually send an exit signal for a position that's already flat. Strategy Sync detects this mismatch, reports it as out_of_sync, and with flatten mode, attempts to flatten (already flat) and waits for the next clean entry. This is expected behavior.
Payload Bracket Setup
Basic TP/SL
CrossTrade creates a limit order for the take profit and a stop market order for the stop loss, both in the opposing direction (SELL for a BUY entry). The tick values are offset from the fill price.
Supported Price Formats
All six bracket price fields (take_profit, stop_loss, stop_loss_limit, stop_loss_stop, limit_price, stop_price) support these formats:
Ticks
50 ticks or 50ticks
50 ticks from fill price
Percentage
2%
2% from fill price
Dollars
$500
$500 from fill price
Points
10 points
10 points from fill price
Absolute
5250.50
Exact price level
TV Variable
{{close}}
Current bar's close price
For the full specification, see Percentage and Tick Prices.
Sign Convention for Stops
stop_loss values are directional relative to the spot price. For a long position, a stop loss is below the entry, so you'd use a negative tick value: stop_loss=-30 ticks;. For a short position, the stop is above, so: stop_loss=30 ticks;.
Good news: CrossTrade will automatically correct the sign if you get it backwards. So stop_loss=30 ticks; on a long position will still place the stop below. But it's good practice to use the correct signs for clarity.
Wait-for-Fill (v1.12.0+)
If your entry is a limit or stop order (not a market order), bracket orders are now held until the entry actually fills. If the entry never fills and gets canceled, the brackets are discarded. No orphaned orders. This is the default behavior as of v1.12.0 and requires no configuration.
Market orders fill immediately, so brackets are submitted alongside the entry as before.
OCO Behavior
When both take_profit and stop_loss are present, they form an OCO (One-Cancels-Other) bracket. When one leg fills, the other is automatically canceled by NT8.
If you include only one side (just TP or just SL), it's a one-sided bracket — the single order stays active until it fills, is canceled, or the position is closed by other means.
TradingView-Managed Exits
With a Strategy (Strategy Sync)
This is the default behavior when using Strategy Sync without an ATM or brackets:
TradingView generates both entry and exit signals. CrossTrade passes both to NT8. Strategy Sync ensures the position state stays aligned. When the strategy transitions from long→flat (an exit), CrossTrade sends the corresponding close order.
This is the cleanest setup when your strategy handles the full trade lifecycle and you trust TV's exit logic.
With an Indicator (Separate Alerts)
Create separate alerts for your close conditions:
Or use a FLATTEN command if you want to also cancel any pending orders:
Tie each close alert to the appropriate indicator condition. See Guide 3 for the full indicator setup.
Hybrid Approaches
Real-world setups often combine methods. Here are the most common hybrids:
ATM Stop Loss + TV Take Profit
Use an ATM with only a stop loss (no profit target set in the template). Let TradingView manage the exit. Add strategy_exit_block=true; only for the protective stop — but this blocks all non-entry signals, so you'd need a separate close alert for the TV-managed exit.
The cleaner version: use a stop_loss= in the payload for the protective stop, and let TV fire a separate CLOSEPOSITION alert for the take profit.
Payload Stop + TV Signal Exit
No take_profit — just a protective stop. The profit-taking exit comes from a separate TradingView alert. If the stop is hit first, the CLOSEPOSITION alert from TV will find a flat account and do nothing (or trigger an out_of_sync warning if using Strategy Sync).
The Orphaned Orders Problem
When a position is closed by any means other than the bracket orders themselves (manual close, NAM flatten, strategy exit signal, etc.), the bracket orders stay active. They're sitting in the market with no parent position, and if price hits one, it opens a new unintended position.
How to prevent orphaned orders:
flatten_first=true;on your next entry will cancel pending orders before opening the new positionFLATTENorCLOSEPOSITIONcommands cancel working orders for the instrumentATM orders grouped under a strategy are cleaned up when the strategy is closed
NAM flatten commands cancel working orders as part of the flatten
The most reliable pattern: always use flatten_first=true; on your entry alerts when using brackets or ATMs. This ensures every new trade starts with a clean slate.
Related Guides:
Guide 2: Automating a TradingView Strategy — Strategy Sync setup in full detail
Guide 3: Automating a TradingView Indicator — indicator-based entry/exit alerts
Guide 4: Managing Multiple Accounts — copier and multi-account setups
Reference Docs:
Last updated