Black Friday, until December 2: FONDEOREAL gives 30% off the 50K, 20% off the 100K and 10% off the 150K at FTMO Futures. See the offer →

Lab · November 2026 · 3 min read

NinjaTrader 8 SetStopLoss Not Working? What to Check

Why SetStopLoss() uses an old stop or misbehaves in NinjaTrader 8: call order, resetting and calculation modes, based on the official guide.

If SetStopLoss() isn't doing what you expect, check the order of your calls and the reset first. You need to call it before you submit the entry. And if you change it during a trade, you need to reset it when you're flat. Otherwise, your next trade uses the last value.

SymptomWhat to check
The new trade uses the previous stopReset the value when the strategy is flat. The guide warns that the last price or offset is used otherwise.
The stop doesn't have the initial level you expectCall SetStopLoss() before the entry: the stop is submitted when the execution arrives.
SetTrailStop() does nothingIt can't be used with SetStopLoss() for the same position. If both are called, SetStopLoss() takes precedence.
The stop is an absurd distance awayCheck the calculation mode. In Percent, 1 is 100%, 0.1 is 10% and 0.01 is 1%.
There are several stop ordersWith partial fills, a strategy can generate one stop per fill or one for all fills. It depends on the stop and target setting.
It fails with several series of the same instrumentSubmit orders for that instrument only from its first Bars context.
The stop disappearsIt's canceled automatically if another strategy exit closes the position.

Moving the stop without carrying over the old value

This example is ours, based on those rules: it sets 20 ticks while flat and, when long, moves the stop to the average entry price once the close is 10 ticks above it.

protected override void OnBarUpdate()
{
    if (CurrentBar < 1) return;

    if (Position.MarketPosition == MarketPosition.Flat)
    {
        SetStopLoss(CalculationMode.Ticks, 20);   // first, the initial stop
        if (Close[0] > Close[1])
            EnterLong();                          // then, the entry
    }
    else if (Position.MarketPosition == MarketPosition.Long
             && Close[0] > Position.AveragePrice + 10 * TickSize)
    {
        SetStopLoss(CalculationMode.Price, Position.AveragePrice);
    }
}

Details worth knowing

On a prop firm account, verify your stop before you rely on it. An old value or the wrong mode changes your risk per trade. Work out how many contracts fit your drawdown and test the strategy in simulation.

If NinjaTrader ignores an order, see the internal order handling rules. If no orders go out, see the 11 causes of a strategy not placing orders.

Want someone to review it? We check the stops and exits in your NinjaScript strategy.

Review from $90 Analyze NinjaTrader with AI

Source

Keep reading

Practise an evaluation, freeAll 91 articles →

Free: The Other Half Workbook. Nine templates for trading with a cool head: your one-page plan, the pre-session checklist, the twelve-patterns test, your size and the bill for your mistakes.

Get the free workbook

Get ready for 2027: the Trader Planner. Each day's US releases in New York time, your pre-market routine and a log for every session.

Paperback on Amazon, $16.99 Get the PDF, $9

Educational content based on the official NinjaTrader documentation. Not investment advice. Test any change on a simulation account before using it live.