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

Strategy library · ES futures

ES opening range breakout

Net profit
+$14,242
+28.5%
Max drawdown
16.1%
the worst dip
Profit factor
1.10
43% won
Trades
512
two years

MES 5-minute, a 15-minute range and a target of twice the risk, 23 October 2024 to 22 October 2026, costs included. The last 8 months, judged on their own: -4.9%.

What held up in our tests:NQ 30-minute opening range breakout+$9,583 over two years, +1.6% in its last 8 months →
Run this script free

Opens on MES 5-minute with the backtest done. Free account, no card.

The account: $50,000 to $64,242 after costs, after each of 512 trades

high $72,806, 17 Aprlast 8 months
+$51 a trade over the first 343−$18 a trade over the last 169

Drawdown, closed trades: worst -16.1% on 5 Dec 2025

Every trade: wins up, losses down. Best +$1,323, worst −$715

Each month

Oct 2024From 24 Feb 2026, the last 8 monthsOct 2026

One opening range breakout script, run 12 ways on MES futures from 23 October 2024 to 22 October 2026 with costs: 5, 15 and 30-minute ranges, targets from 1 to 3 times the risk. 11 of the 12 made money in the first 16 months; all 12 lost money in the 8 months after. The 15-minute range made the most: at 1.5R it made 47.8% and then lost 2.9%.

  • Checked 6 November 2026, re-run 16 November 2026
  • MES1! 5-minute, 23 October 2024 → 22 October 2026 · 2 years · 517 sessions
  • $0.75 a contract each side + 1 tick of slippage
  • $50,000 account, 1% risk, one trade a day
  • last 8 months judged alone, from 24 February 2026
  • Updated 28 November 2026

The rules

The opening range study's script, the same on ES as on NQ; only the range length and the target change.

  1. The range: the high and low from 9:30 New York to 9:35, 9:45 or 10:00.
  2. The entry: the first 5-minute close outside the range, before 12:00 New York, long above and short below, filled at the next candle's open.
  3. The stop: the other side of the range. The target: 1, 1.5, 2 or 3 times the risk.
  4. The size: contracts from a 1% risk over the stop's dollars, with two ticks of slippage counted, at most 10.
  5. One trade a day, and flat on the session's last candle.

All 12 versions on MES

Net return on the $50,000 account after costs, the last 8 months first: 24 February 2026 → 22 October 2026.

VersionLast 8 monthsFirst 16 monthsTwo yearsTradesWonProfit factor
5 min · 1R-3.0%-5.3%-8.1%51551.3%0.96
5 min · 1.5R-7.2%+1.4%-5.9%51542.5%0.98
5 min · 2R-9.5%+3.8%-6.1%51537.9%0.98
5 min · 3R-21.2%+25.8%-0.9%51534.2%1.00
15 min · 1R-2.0%+31.0%+28.4%51254.1%1.12
15 min · 1.5R-2.9%+47.8%+43.5%51247.5%1.15
15 min · 2R-4.9%+35.2%+28.5%51243.0%1.10
15 min · 3R-7.3%+31.6%+22.0%51241.6%1.08
30 min · 1R-4.0%+2.5%-1.5%49050.6%0.99
30 min · 1.5R-5.9%+0.6%-5.4%49045.7%0.97
30 min · 2R-6.9%+0.2%-6.7%49044.7%0.96
30 min · 3R-0.5%+9.9%+9.4%49044.7%1.05

11 of 12 made money in the first 16 months, and none in the 8 after, when they ended between -21.2% and -0.5%. The 15-minute range made the most before them and, at targets up to 2R, lost the least in them; the 5-minute range lost over the two years at every target.

The version that made the most before the last 8 months was the 15-minute range at 1.5R, +47.8%; in the 8 months after it made -2.9%. Picking it after seeing the table is how a backtest flatters itself.

The script

Copy it into TradingView, or press Run and it opens on MES 5-minute in the terminal with its backtest done. The other versions change only the range and the target.

MES opening range breakout, 15-minute range, 2R

The range from 9:30 to 9:45 New York, long on the first 5-minute close above it and short below until 12:00, the stop at the other side, the target at twice the risk, one trade a day and flat at the session's end.

Trades
512
Won
43.0%
Profit factor
1.10
Net
+28.5%
Worst drawdown
−16.1%
Worst trade
−⁠$715

MES1! · 5-minute · 23 October 2024 → 22 October 2026 · 2 years · 517 sessions · $0.75 a contract each side, one tick of slippage, $50,000 account, 1% risk

+35.2% in the first 16 months, -4.9% in the last 8. 43.0% of trades won.

Pine Script v6 · 80 linesRun this script
//@version=6
// Suggested timeframe: 5-minute
strategy("MES Opening Range Breakout", overlay=true, initial_capital=50000, default_qty_type=strategy.fixed, default_qty_value=1,
     commission_type=strategy.commission.cash_per_contract, commission_value=0.75, slippage=1, margin_long=0, margin_short=0)

// Inputs
orSess       = input.session("0930-0945", "Opening range (New York)")
tradeSess    = input.session("0945-1200", "Entry window (New York)")
riskPct      = input.float(1.0, "Risk % per trade", minval=0.1, step=0.1)
rMult        = input.float(2.0, "Target (R)", minval=0.5, step=0.5)
maxContracts = input.int(10, "Max contracts", minval=1)
maxTrades    = input.int(1, "Max trades per day", minval=1)

// The clock is New York's; a future's day starts at the 18:00 New York reopen
inOR    = not na(time(timeframe.period, orSess, "America/New_York"))
inTrade = not na(time(timeframe.period, tradeSess, "America/New_York"))

// The day's state: every level, flag and count the setup keeps, declared here and set back on the day's first bar
var float orHigh      = na
var float orLow       = na
var int   tradesToday = 0
var bool  doneToday   = false
var float stopLevel   = na
var float targetLevel = na
if session.isfirstbar
    orHigh      := na
    orLow       := na
    tradesToday := 0
    doneToday   := false

// The setup: the first close outside the 15-minute opening range
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
longStop   = orLow
shortStop  = orHigh

// A win ends the day: counted before the entries, so the bar it closes on opens nothing; a winner held to the
// session's end is booked on the next session's first bar and ends nothing there
if strategy.closedtrades > strategy.closedtrades[1] and strategy.closedtrades.profit(strategy.closedtrades - 1) > 0 and not session.isfirstbar
    doneToday := true

// Entries: inside the window, flat, under the day's caps; the qty from the risk (a stop too wide skips the
// trade), the stop and target placed with the entry
canTrade = inTrade and strategy.position_size == 0 and tradesToday < maxTrades and not doneToday and barstate.isconfirmed
riskCash = math.max(strategy.equity, 0) * riskPct / 100
if canTrade and longSetup and not na(longStop) and longStop < close
    stopPts = close - longStop
    qty = math.min(maxContracts, math.floor(riskCash / ((stopPts + 2 * syminfo.mintick) * syminfo.pointvalue)))
    if qty >= 1
        stopLevel   := longStop
        targetLevel := close + stopPts * rMult
        strategy.entry("Long", strategy.long, qty=qty)
        strategy.exit("Long exit", from_entry="Long", stop=stopLevel, limit=targetLevel)
        tradesToday := tradesToday + 1
if canTrade and shortSetup and not na(shortStop) and shortStop > close
    stopPts = shortStop - close
    qty = math.min(maxContracts, math.floor(riskCash / ((stopPts + 2 * syminfo.mintick) * syminfo.pointvalue)))
    if qty >= 1
        stopLevel   := shortStop
        targetLevel := close - stopPts * rMult
        strategy.entry("Short", strategy.short, qty=qty)
        strategy.exit("Short exit", from_entry="Short", stop=stopLevel, limit=targetLevel)
        tradesToday := tradesToday + 1

// The same stop and target 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)
plotshape(canTrade and longSetup, "Long", style=shape.triangleup, location=location.belowbar, color=color.new(#16A56A, 0), size=size.tiny)
plotshape(canTrade and shortSetup, "Short", style=shape.triangledown, location=location.abovebar, color=color.new(#E5484D, 0), size=size.tiny)

5, 15 or 30 minutes, ES beside NQ

The study's script with a target of twice the risk, the range its only change, on MES and on MNQ.

RangeLast 8 monthsFirst 16 monthsTradesWorst drawdown
MES · 5 minutes-9.5%+3.8%515-26.7%
MES · 15 minutes-4.9%+35.2%512-16.1%
MES · 30 minutes-6.9%+0.2%490-19.3%
MNQ · 5 minutes-20.3%+57.5%514-24.2%
MNQ · 15 minutes-13.7%+30.0%499-20.9%
MNQ · 30 minutes-3.4%+9.4%421-13.3%

Every version on both markets: the opening range study. The tester for your own ES script: the ES futures backtester.

Run your version free

Change the range, the target or the risk, or paste your own ORB. It runs free on the newest 30 days with the same costs, every trade on the chart, and on all two years with Prop Ready.

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

Does the opening range breakout work on ES?

It did for 16 months, then it stopped. On MES, 11 of 12 versions made money from 23 October 2024 to 24 February 2026, and none made money in the 8 months after, after costs. Over the two years 5 of 12 were up: the four with a 15-minute range, and the 30-minute range at 3R.

What is the best opening range length for ES?

In the first 16 months, 15 minutes: every target made money, +31.0% to +47.8%. In the last 8 months it lost too, -2.0% to -7.3%, less than the 5-minute range lost. Picking a length after seeing the table is how a backtest flatters itself.

Is the opening range breakout better on ES or NQ?

Neither held up. On MNQ and on MES the same script made money in the first 16 months at most lengths and targets and lost in the last 8. Only one of the study's 24 versions made money in those 8 months, MNQ's 30-minute range at 1R, and by 1.6%.

Can I run my own version?

Yes. Run this script opens the Alpha Charts terminal on MES 5-minute with the script on the chart and its backtest done. Change the range, the target or the risk, or ask the Copilot to, and run it again. A free account runs as many tests as you like, no card.

Every number here is the Alpha Charts backtest engine on MES1! 5-minute bars from 23 October 2024 to 22 October 2026, the opening range study's runs of 6 November 2026, re-run on 16 November 2026 to the same figures, with the costs above. A backtest describes the past; it is not a forecast or advice.

The ES opening range breakoutFree account, no cardRun it free