🔥 Black Friday Sale 🔥 Black Friday Sale 40% OFF Sitewide – Up to 70% OFF Select Products Shop Black Friday Ends in Sunday, November 22 🏆 Compare Trade Copiers →
Articles

NinjaTrader Trailing Stop: How to Set Auto Trail and Breakeven in NinjaTrader 8

By Affordable Indicators· November 4, 2021·12 min read
NinjaTrader Trailing Stop: How to Set Auto Trail and Breakeven in NinjaTrader 8

To set a trailing stop in NinjaTrader 8, give your ATM Strategy a Stop Strategy: pick <Custom> in the ATM Strategy list in Chart Trader or the SuperDOM, choose <Custom> in its Stop Strategy list, and enter Auto Trail’s Stop Loss, Profit Trigger and Frequency in ticks. The same dialog has Auto Breakeven, which moves the stop to your entry price once price has moved a set number of ticks your way. Save it as a template and select it before you enter, and NinjaTrader moves the stop with price and never moves it back.

Steps are for NinjaTrader 8.1.x, checked against NinjaTrader’s help guide in October 2026. Menu names follow 8.1.5 and later, where Tools › Options became Tools › Settings. Some help guide pages still show Tools › Options.

This guide is for NinjaTrader 8 desktop traders who want their stop loss to follow price. It covers trailing and breakeven only.

What a trailing stop does

A trailing stop is a stop loss order that moves with price. When price moves in your trade’s direction, the stop follows it at a set distance. When price turns against you, the stop stays where it is. The distance can be a fixed number of ticks, or it can follow something on the chart, such as a moving average.

Breakeven is a one-time move. Once price has moved a set number of ticks your way, the stop moves to your entry price. You can use both in one Stop Strategy: breakeven first, then the trail takes over.

A NinjaTrader trailing stop loss isn’t a separate order type. It is an ordinary stop order that NinjaTrader moves for you, which is why it matters whether NinjaTrader is running (see below).

Three ways to trail a stop in NinjaTrader 8

NinjaTrader 8 gives you three ways to trail a stop, each set in a different place:

Method Where you set it How the stop moves Who it suits
ATM Stop Strategy (Auto Trail and Auto Breakeven) The Stop Strategy list in the ATM Strategy’s parameters (Chart Trader or SuperDOM) In tick steps once a trigger is reached, with up to 3 steps Manual traders who want the same trail on every trade
Attach to Indicator The stop’s order label in Chart Trader Follows an indicator plot, plus an offset in ticks Traders who trail behind a moving average or another plot
NinjaScript SetTrailStop() In a strategy’s code A fixed offset in ticks, percent or pips, updated as the strategy calculates Automated strategies

Use one method per stop. Attaching an ATM stop to an indicator turns its Stop Strategy off, and in NinjaScript SetTrailStop() can’t share a position with SetStopLoss().

How to set a NinjaTrader trailing stop with ATM Auto Trail

Auto Trail is part of a Stop Strategy, which NinjaTrader’s help guide describes as an extension of an ATM (Advanced Trade Management) Strategy. The ATM places your stop loss and target when the entry fills, and the Stop Strategy adjusts that stop afterwards.

  1. Open Chart Trader on your chart. If you haven’t used it yet, see how to use Chart Trader in NinjaTrader 8.
  2. In the ATM Strategy list, choose <Custom>. The Custom Strategy Parameters window opens.
  3. Set your stop loss and target in ticks. Our guide to bracket and OCO orders covers this part and saving the ATM template.
  4. In the Stop Strategy list for that stop, choose <Custom> to open the Stop Strategy dialog.
  5. Under Auto Trail, enter Stop Loss, Profit Trigger and Frequency for step 1. Fill in steps 2 and 3 only if you want the trail to change as the trade goes on.
  6. Click Save as Template, name the Stop Strategy, click Save, then click OK.
  7. Save the ATM Strategy as a template and select it in the ATM Strategy list before you enter. NinjaTrader places the stop when the entry fills, and the Stop Strategy manages it from there.

Each Auto Trail step has three fields, all in ticks:

Auto Trail field What it sets
Profit Trigger How far price must move past your average entry price before this step makes its first adjustment
Stop Loss How far behind the trigger price the stop is placed
Frequency How far price must move again before each further adjustment

NinjaTrader’s Auto Trail page gives this example for an S&P E-mini long at 1000, where one tick is 0.25. With a Profit Trigger of 4, a Stop Loss of 6 and a Frequency of 2, nothing moves until price reaches 1001. The stop then moves to 999.50, six ticks behind 1001, and moves up another 2 ticks each time price moves 2 more ticks.

  • Ticks only. Stop Strategy values are always in ticks. Price and Currency can’t be used.
  • Never backward. NinjaTrader’s FAQ says a Stop Strategy will never move your stop loss backward, so a later step with a wider Stop Loss won’t pull the stop back.
  • Three steps locally, one on the server. Local ATMs have three Auto Trail steps. Server-side ATMs, covered below, have one.
  • Example values. NinjaTrader’s ATM tutorial uses Auto Breakeven at 6 ticks and Auto Trail with a 4-tick Stop Loss, an 8-tick Profit Trigger and a 1-tick Frequency, saved as a Stop Strategy named “Basic Stop”. They are teaching values, not a recommendation, so test your own on a simulation account first.

How to add Auto Breakeven and combine it with Auto Trail

Auto Breakeven moves the stop to your average entry price once price has moved the Profit Trigger distance your way. It has two fields:

  • Profit Trigger: how many ticks price must move past your entry before the stop moves.
  • Plus: ticks added to the entry price. At 0 the stop goes exactly to your entry. At 1 it goes one tick past it.

In NinjaTrader’s Auto Breakeven example, a long at 1000 with a Profit Trigger of 8 ticks and Plus of 0 triggers at 1002, and the stop moves to 1000.

To use both in one Stop Strategy, NinjaTrader’s FAQ says the Auto Trail Profit Trigger must be higher than the Auto Breakeven Profit Trigger. The stop moves to breakeven first, then the trail takes over.

One setting affects both features. In the ATM strategy options under Tools › Settings › Strategies, Use last price for auto trail and auto breakeven makes the last traded price trigger the moves. With it off, NinjaTrader uses the bid for longs and the ask for shorts. The help guide lists this option as available only when server-side ATMs are off.

Turn the trail on or off during a trade

On a local ATM you can switch Auto Trail or Auto Breakeven on or off after you are in the trade. NinjaTrader’s help guide describes this in the SuperDOM:

  1. Right-click the active stop in the buy or sell cell and open that order’s submenu.
  2. Click Enable for Auto Trail or Enabled for Auto Breakeven (the help guide uses both labels) to switch it on or off.
  3. To change the values, switch the feature off first, then use Auto Trail Properties or Auto Breakeven Properties.

On server-side ATMs you can’t switch the Stop Strategy on or off once the ATM is active, so set it up before the entry.

Breakeven hot keys. To move a stop to breakeven by hand, NinjaTrader has two order entry hot keys. Breakeven ATM Strategy moves the stop loss to break-even for the ATM position in the active window. Breakeven Position moves any stops to break-even for any open position. Turn on Use order entry hot keys under Tools › Settings › Trading, then assign keys in Tools › Hot Keys in the Control Center. NinjaTrader’s hot key page says to keep track of which window is active when you use order entry hot keys, so click the chart or SuperDOM you mean first.

Trail a stop on an indicator with Attach to Indicator

Chart Trader can attach a resting order to an indicator plot, so the order moves when the plot moves. On a stop, this trails it behind a moving average or another indicator on the chart, with no add-on needed.

  1. Add the indicator to the chart, in the same panel as the price series you trade.
  2. Left-click the label on the stop’s order line, hold Ctrl and left-click anywhere on the chart. Or right-click the label and choose Attach to Indicator › Properties.
  3. In Attach to Indicator Properties, pick the Indicator to follow. If more than one indicator is on the chart, check that the right one is selected.
  4. Set the Offset in ticks to keep the stop above or below the plot.
  5. Turn on Modify toward last price only. The stop then moves only toward the last traded price, never further away, which is what makes it behave as a trailing stop.
  6. Click OK.

NinjaTrader’s help guide sets two limits. On an ATM, Attach to Indicator applies only to a stop with no Stop Strategy, and turning it on disables the Stop Strategy. And the stop updates as often as the indicator calculates, so an indicator set to calculate on bar close moves the stop once per bar.

NinjaScript trailing stop: SetTrailStop()

If you write your own strategies, NinjaScript has a built-in trailing stop. SetTrailStop() submits a stop-market order named “Trail stop” when the entry fills, then moves it as the strategy calculates.

  • Syntax: SetTrailStop(CalculationMode mode, double value), or SetTrailStop(string fromEntrySignal, CalculationMode mode, double value, bool isSimulatedStop) to tie it to one entry signal.
  • Modes: Ticks, Percent or Pips. Price and Currency don’t apply to trail stops.
  • Where to call it: before the entry. For a fixed offset, call it in OnStateChange() when the state is State.Configure, for example SetTrailStop(CalculationMode.Ticks, 12);. To change the offset mid-trade, call it from OnBarUpdate() and reset it when the strategy is flat.
  • How often it moves: as often as the strategy’s Calculate setting allows. On bar close, it is adjusted from the bar’s high or low.
  • Conflicts: it can’t be combined with SetStopLoss() or SetParabolicStop() on the same position, and SetStopLoss() takes precedence. If the strategy also places a target order, the two orders go out as OCO.

Does the stop keep trailing if NinjaTrader is closed?

On a standard local ATM, no: the trailing is done by NinjaTrader on your computer, and NinjaTrader’s FAQ (checked October 2026) says NinjaTrader must be connected for an ATM’s functions to run, so Auto Trail and Auto Breakeven don’t move the stop while NinjaTrader is closed or disconnected. Attach to Indicator and NinjaScript trailing stops also run inside NinjaTrader, so the same applies. NinjaTrader’s help guide lists server-side ATMs as a beta for the NinjaTrader connection only, available only with Multi-provider off, and as of October 2026 it doesn’t say whether they keep trailing while the platform is closed. Our bracket order guide covers server-side ATMs and where the OCO link between your stop and target is handled on your connection.

Trailing stop types in the Enhanced Chart Trader

NinjaTrader’s own tools trail in tick steps (Auto Trail), behind one indicator per order (Attach to Indicator) or in code (SetTrailStop()). Advanced Exit Orders Management, a module of our Enhanced Chart Trader for NinjaTrader traders, adds ATR and previous-bar trailing alongside fixed-tick and indicator trailing, and its trailing methods can be configured on the fly:

  • Fixed: the stop trails by a fixed number of ticks.
  • ATR: the trailing distance is based on the current Average True Range value, so it changes as ATR changes.
  • Bar: the stop follows the high or low of the previous bar.
  • Indicator: the stop follows any plot visible on the chart. You can set up to 10 custom indicator trailing stops in the Manage Custom Trailing Stops dialog, where you pick the plot and the offset, and each one then shows in the trailing stop dropdown.

It can also place the initial stop and target from the previous bar’s high or low, or from ATR times a multiplier, and its ATM Strategy Planning shows where your exit orders will go so you can adjust them on the chart before the entry fills. It includes our Basic Chart Trader Tools, which can add a breakeven button on the chart and in the control panel. Like a local ATM, these trailing stops run inside NinjaTrader, so they stop moving while NinjaTrader is closed.

Frequently asked questions

What is a trailing stop?

A trailing stop is a stop loss order that follows price as it moves in your trade’s direction. In NinjaTrader 8 you set one with Auto Trail, Attach to Indicator or NinjaScript’s SetTrailStop().

How do I add a trailing stop loss to a NinjaTrader order?

Before the entry, select an ATM Strategy template whose Stop Strategy has Auto Trail set, and NinjaTrader trails the stop it places when the entry fills. For a stop that is already placed, switch Auto Trail on from the stop’s right-click menu on a local ATM, or attach the stop to an indicator in Chart Trader.

Is there a NinjaTrader breakeven button?

NinjaTrader’s built-in way is Auto Breakeven in an ATM Stop Strategy, which moves the stop to your entry price once price has moved a set number of ticks your way. Going by NinjaTrader’s help guide (checked October 2026), there is no built-in breakeven button in Chart Trader; for a manual move, NinjaTrader has the Breakeven ATM Strategy and Breakeven Position hot keys. Our Basic Chart Trader Tools can add a Breakeven button on the chart and in the control panel.

How do I code a NinjaScript trailing stop?

Call SetTrailStop() before your entry, for example SetTrailStop(CalculationMode.Ticks, 12); in OnStateChange() when the state is State.Configure. Don’t combine it with SetStopLoss() on the same position, because SetStopLoss() takes precedence.

Can a NinjaTrader trailing stop loss move back?

Not with a Stop Strategy: NinjaTrader’s FAQ says Auto Trail and Auto Breakeven never move the stop backward. With Attach to Indicator, turn on Modify toward last price only, or the stop follows the indicator both ways.

Next, size the trade to your stop distance with NinjaTrader position sizing, or browse the rest of our NinjaTrader guide.

Trade with the right tools. Our NinjaTrader trade copier mirrors your trades across every prop-firm account, and our chart trader tools put one-click order management on your chart — lifetime licenses, free updates, live chat support.
See the trade copier →
Buy with Confidence · 🛡️ 8,000+ customers · ⭐ 4.8 Trustpilot · 🏆 18 years programming experience