Black Friday: 2 years for the price of 1.Or 3 months for the price of 1. On Pro.2 d 5 hleftSee plans →
Free tool

Trailing stop or fixed target on NQ's opening range: which kept more?

NQ's 15-minute opening range tested on MNQ from 4 November 2024 to 22 October 2026. The same entries exit at a fixed target or with a trailing stop. Written in Pine Script? Paste it here: a free account with no card runs it on CME Group futures with $2.50 a contract and a tick of slippage charged.

Free plan · unlimited backtests · no card
NQ's 15-minute opening range · a 1R trailing stop against a 2R targetMNQ1! · 5-minute · 4 November 2024 → 22 October 2026
Trail 1R over 2 years
−$694.50
Target 2R over 2 years
+$1,222
Trail 1R best trade
+$2,049.50
Trail 1R 24 Feb 2026 → 22 Oct 2026
−$3,091.50
Trailing stop of 1R−$694.50
Fixed target of 2R+$1,222
Nov 2024Feb 2026Oct 2026

The $50,000 account after each trade. One MNQ contract pays $2.50 a contract each side and a tick of slippage. Dashed: the same entries with a 2R target. Shaded: from 24 February 2026.

Paste your script

Pine v6, as TradingView has it.

NQ's 15-minute opening range · a 1R trailing stop against a 2R targetMNQ1! · 5-minute · 4 November 2024 → 22 October 2026
Trail 1R over 2 years
−$694.50
Target 2R over 2 years
+$1,222
Trail 1R best trade
+$2,049.50
Trail 1R 24 Feb 2026 → 22 Oct 2026
−$3,091.50
Trailing stop of 1R−$694.50
Fixed target of 2R+$1,222
Nov 2024Feb 2026Oct 2026

The $50,000 account after each trade. One MNQ contract pays $2.50 a contract each side and a tick of slippage. Dashed: the same entries with a 2R target. Shaded: from 24 February 2026.

The fixed target kept more.

We ran NQ's 15-minute opening range on MNQ 5-minute bars from 4 November 2024 to 22 October 2026. The same entries exited at a fixed target of 1R, 1.5R, 2R or 3R. They also ran with a trailing stop of 1R, 0.5R, 2× ATR or 3× ATR. Fixed targets of 1R, 1.5R and 2R made $1,222 to $6,693 over two years. Every trailing stop lost money: $694.50 to $5,453. The trails cut the average loss to $87–$161 from $224–$231. Fewer of their trades won. None of the 8 runs made money from 24 February 2026 to 22 October 2026.

All 8 runs

EXITTRADESWON2 YEARS4 NOV 2024 → 23 FEB 202624 FEB 2026 → 22 OCT 2026WORST DRAWDOWN
Target 1R50053.2%+$6,693+$10,064.50−$3,371.50−$5,347.50
Target 1.5R50048.2%+$6,308.50+$12,188−$5,879.50−$8,995
Target 2R50045.2%+$1,222+$8,850−$7,628−$10,373.50
Target 3R50044.2%−$6.50+$8,094−$8,100.50−$11,648
Trail 1R50039.8%−$694.50+$2,397−$3,091.50−$5,707
Trail 0.5R50034.2%−$2,235+$684.50−$2,919.50−$5,555.50
Trail 2× ATR50032.8%−$5,453−$1,156.50−$4,296.50−$7,896.50
Trail 3× ATR50038.4%−$2,376.50+$4,856.50−$7,233−$8,474

One MNQ contract on a $50,000 account pays $2.50 a contract each side and a tick of slippage. The worst drawdown is the deepest fall from a high between 4 November 2024 and 22 October 2026. The 8 settings were fixed before the runs.

Why the trailing stops kept less

A trailing stop cut the average loss to $87–$161. With a fixed target it was $224–$231. It also stopped out more trades. With a trail 32.8% to 39.8% of trades won; with a fixed target 44.2% to 53.2% did. Its best trade was larger: +$2,049.50 with the 1R trail against +$1,781 at 2R. Over two years the smaller losses did not make up for the fewer wins.

EXITAVERAGE WINAVERAGE LOSSBEST TRADEOPEN AT THE DAY'S END
Target 1R+$228.60−$231.26+$888109 of 500
Target 1.5R+$272.74−$229.43+$1,334.50182 of 500
Target 2R+$279.45−$226.03+$1,781232 of 500
Target 3R+$282.80−$224.03+$1,450.50272 of 500
Trail 1R+$239.94−$160.94+$2,049.50118 of 500
Trail 0.5R+$153.49−$86.57+$1,7129 of 500
Trail 2× ATR+$151.90−$90.37+$1,663.500 of 500
Trail 3× ATR+$214.18−$141.23+$2,00413 of 500

The script as it ran

NQ 15-minute opening range with a 1R trailing stop

The range is 9:30 to 9:45 New York. From 9:45 to 12:00 the first 5-minute close outside it enters. The stop starts at the range's other side. At each 5-minute close it moves to the best price since entry less the trade's risk and never moves back. There is no target; one trade a day. Its Exit input switches to Target or Trail by ATR.

Trades
500
Won
39.8%
Profit factor
0.99
Net
−1.4%
Worst drawdown
−10.6%
Worst trade
−$537

MNQ1! · 5-minute · 4 Nov 2024 → 22 Oct 2026 · $2.50 a contract each side and a tick of slippage · one contract on a $50,000 account

+$2,397 from 4 November 2024 to 23 February 2026, −$3,091.50 from 24 February 2026 to 22 October 2026.

Pine Script v6 · 79 linesRun this script
//@version=6
// Suggested timeframe: 5-minute
strategy("NQ Opening Range: fixed target or trailing stop", overlay=true, initial_capital=50000, default_qty_type=strategy.fixed, default_qty_value=1,
     commission_type=strategy.commission.cash_per_contract, commission_value=2.5, slippage=1, margin_long=0, margin_short=0)

// Inputs: the opening range, the entry window and how the trade exits, all on New York's clock
orSess    = input.session("0930-0945", "Opening range (New York)")
tradeSess = input.session("0945-1200", "Entry window (New York)")
exitMode  = input.string("Trail by R", "Exit", options=["Target", "Trail by R", "Trail by ATR"])
rMult     = input.float(2.0, "Target (R)", minval=0.5, step=0.5)
trailR    = input.float(1.0, "Trail (R)", minval=0.25, step=0.25)
trailAtr  = input.float(2.0, "Trail (ATR multiple)", minval=0.5, step=0.5)
atrLen    = input.int(14, "ATR length", minval=1)

inOR    = not na(time(timeframe.period, orSess, "America/New_York"))
inTrade = not na(time(timeframe.period, tradeSess, "America/New_York"))
atr     = ta.atr(atrLen)

// The day's state, set back on the futures day's first bar (18:00 New York)
var float orHigh      = na
var float orLow       = na
var int   tradesToday = 0
var float stopLevel   = na
var float targetLevel = na
var float riskPts     = na
var float bestPrice   = na
if session.isfirstbar
    orHigh      := na
    orLow       := na
    tradesToday := 0

// The setup: the first close outside the opening range; the stop at the range's other side
if inOR
    orHigh := na(orHigh) ? high : math.max(orHigh, high)
    orLow  := na(orLow) ? low : math.min(orLow, low)
rangeSet   = not inOR and not na(orHigh)
longSetup  = rangeSet and close > orHigh and close[1] <= orHigh
shortSetup = rangeSet and close < orLow and close[1] >= orLow

// One trade a day, one micro contract, inside the window, flat
canTrade = inTrade and strategy.position_size == 0 and tradesToday < 1 and barstate.isconfirmed
if canTrade and longSetup and orLow < close
    stopLevel   := orLow
    riskPts     := close - orLow
    targetLevel := exitMode == "Target" ? close + riskPts * rMult : na
    bestPrice   := close
    strategy.entry("Long", strategy.long)
    strategy.exit("Long exit", from_entry="Long", stop=stopLevel, limit=targetLevel)
    tradesToday := tradesToday + 1
if canTrade and shortSetup and orHigh > close
    stopLevel   := orHigh
    riskPts     := orHigh - close
    targetLevel := exitMode == "Target" ? close - riskPts * rMult : na
    bestPrice   := close
    strategy.entry("Short", strategy.short)
    strategy.exit("Short exit", from_entry="Short", stop=stopLevel, limit=targetLevel)
    tradesToday := tradesToday + 1

// A trailing exit moves the stop at each bar's close and never back: the best price since entry, less
// the trail (the trade's risk times Trail (R), or the ATR times its multiple)
trailDist = exitMode == "Trail by R" ? riskPts * trailR : exitMode == "Trail by ATR" ? atr * trailAtr : na
if strategy.position_size > 0 and exitMode != "Target"
    bestPrice := math.max(bestPrice, high)
    stopLevel := math.max(stopLevel, bestPrice - trailDist)
if strategy.position_size < 0 and exitMode != "Target"
    bestPrice := math.min(bestPrice, low)
    stopLevel := math.min(stopLevel, bestPrice + trailDist)

// The stop, and the target when there is one, on every bar of the trade; flat on the session's last bar
if strategy.position_size > 0
    strategy.exit("Long exit", from_entry="Long", stop=stopLevel, limit=targetLevel)
if strategy.position_size < 0
    strategy.exit("Short exit", from_entry="Short", stop=stopLevel, limit=targetLevel)
if session.islastbar
    strategy.close_all("Session end", immediately=true)

plot(rangeSet ? orHigh : na, "Range high", color=color.new(#16A56A, 0), style=plot.style_linebr)
plot(rangeSet ? orLow : na, "Range low", color=color.new(#E5484D, 0), style=plot.style_linebr)
plot(strategy.position_size != 0 ? stopLevel : na, "Stop", color=color.new(#3D69A8, 0), style=plot.style_linebr)

The same entries are tested with a VWAP filter in Does a VWAP filter improve the NQ opening range breakout? and on the retest in Breakout or retest on NQ's opening range.

Free account

No card, no time limit.

$0
  • Unlimited backtests, costs charged, with the out-of-sample check
  • The Pine script audit and the full trade list
  • The Pine Copilot writes and edits your script
  • 50 AI credits a day
The Alpha Charts terminal a free account opens: the Pine Copilot beside the chart

Prop Ready opens all two years of futures minute bars on a computer for $39 paid once and has 7 days money back. Pro adds the optimiser and every AI tool and has 30 days money back. See the plans

Questions

Trailing stop or fixed target on NQ's opening range: which kept more?

The fixed target. On MNQ 5-minute bars from 4 November 2024 to 22 October 2026, fixed targets of 1R, 1.5R and 2R made $1,222 to $6,693 over two years. All four trailing stops lost money: $694.50 to $5,453. None of the 8 runs made money from 24 February 2026 to 22 October 2026.

How did the trailing stops work?

The stop starts at the range's other side. At each 5-minute close it moves to the best price since entry less the trail. It never moves back. The trail is the trade's risk (1R) or half of it (0.5R). The ATR trails use two or three times the 14-bar ATR. There is no target with a trail. A trade still open closes on the futures day's last bar.

Why did the trailing stops keep less?

They cut losses but stopped out more trades. The average loss fell to $87–$161 from $224–$231 with a fixed target. With a trail 32.8% to 39.8% of trades won; with a fixed target 44.2% to 53.2% did. The biggest single trade was larger with a trail: +$2,049.50 with the 1R trail against +$1,781 at 2R.

Did a trailing stop do better in 2026?

Two did. The 0.5R and 1R trails lost the least of the 8 runs from 24 February 2026 to 22 October 2026: $2,919.50 and $3,091.50. The 1R target lost $3,371.50 there and the 2R target $7,628. No run made money there.

What were the rules and the costs?

The opening range is 9:30 to 9:45 New York on 5-minute bars. From 9:45 to 12:00 the first close outside the range enters at the next bar's open. Its first stop sits at the range's other side. A fixed target is 1, 1.5, 2 or 3 times the risk. There is one trade a day. A trade still open closes on the futures day's last bar. One MNQ contract on a $50,000 account pays $2.50 a side and a tick of slippage.

Can I run it myself?

Yes. Run opens the script on MNQ 5-minute bars in the Alpha Charts terminal. On a computer, a free account with no card runs it as published on all two years. Its Exit input switches to Target or Trail by ATR. A changed input or line makes it your own script: a free account then tests the newest 30 days of a chart under an hour. Prop Ready ($39 paid once) opens all two years for 30 days.

Is a backtest a prediction?

No. It is what a strategy's rules would have done on past prices with costs charged. Live fills, news and your own execution differ. Read it as a test of the rules and not as a forecast.

Every number comes from Alpha Charts' tester on MNQ 5-minute bars from 4 November 2024 to 22 October 2026. The runs were made on 27 November 2026. Alpha Charts is software for testing trading scripts and gives no investment advice. A backtest shows what rules would have done on past data. It does not show what they will do. Our methodology is in Data and methodology. Updated 28 November 2026.

Test your Pine Script freeFree account, no cardPaste your script