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

Does a VWAP filter improve the NQ opening range breakout?

The 15-minute NQ opening range tested 12 ways on MNQ from 4 November 2024 to 22 October 2026. Four targets ran three ways: no filter, a VWAP from 18:00 New York and a VWAP from 9:30. 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 at 2R · the 18:00 VWAP filter against noneMNQ1! · 5-minute · 4 November 2024 → 22 October 2026
With the filter over 2 years
+$3,102.50
No filter over 2 years
+$1,222
Days it changed
45 of 500
Filter 24 Feb 2026 → 22 Oct 2026
−$4,537
With the 18:00 VWAP filter+$3,102.50
With no filter+$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 script with the filter off. Shaded: from 24 February 2026.

Paste your script

Pine v6, as TradingView has it.

NQ's 15-minute opening range at 2R · the 18:00 VWAP filter against noneMNQ1! · 5-minute · 4 November 2024 → 22 October 2026
With the filter over 2 years
+$3,102.50
No filter over 2 years
+$1,222
Days it changed
45 of 500
Filter 24 Feb 2026 → 22 Oct 2026
−$4,537
With the 18:00 VWAP filter+$3,102.50
With no filter+$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 script with the filter off. Shaded: from 24 February 2026.

The VWAP from the futures day's 18:00 open helped at three of four targets. The VWAP from 9:30 changed nothing.

We ran the 15-minute NQ opening range at 1R, 1.5R, 2R and 3R on MNQ 5-minute bars from 4 November 2024 to 22 October 2026. Each target ran three ways: no filter, a VWAP from 18:00 New York and a VWAP from 9:30. With a filter on, a long needs a close above the VWAP and a short a close below it. The 18:00 filter made $716.50 to $2,307.50 more over two years at 1.5R to 3R. At 1R it made $1,215.50 less. The 9:30 VWAP never blocked a trade. None of the 12 runs made money from 24 February 2026 to 22 October 2026.

All 12 runs

RUNTRADES2 YEARS4 NOV 2024 → 23 FEB 202624 FEB 2026 → 22 OCT 2026WORST DRAWDOWN
1R · No filter500+$6,693+$10,064.50−$3,371.50−$5,347.50
1R · VWAP from 18:00472+$5,477.50+$9,094−$3,616.50−$6,229.50
1R · VWAP from 9:30500+$6,693+$10,064.50−$3,371.50−$5,347.50
1.5R · No filter500+$6,308.50+$12,188−$5,879.50−$8,995
1.5R · VWAP from 18:00472+$7,025+$11,467−$4,442−$8,205.50
1.5R · VWAP from 9:30500+$6,308.50+$12,188−$5,879.50−$8,995
2R · No filter500+$1,222+$8,850−$7,628−$10,373.50
2R · VWAP from 18:00472+$3,102.50+$7,639.50−$4,537−$8,788
2R · VWAP from 9:30500+$1,222+$8,850−$7,628−$10,373.50
3R · No filter500−$6.50+$8,094−$8,100.50−$11,648
3R · VWAP from 18:00472+$2,301+$7,015.50−$4,714.50−$9,818.50
3R · VWAP from 9:30500−$6.50+$8,094−$8,100.50−$11,648

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 12 settings were fixed before the runs.

What the 18:00 filter changed

At 2R the filter left 28 days without a trade. Without the filter those trades made +$1,064.50 together. On 17 more days it skipped the first breakout and took a later one. Those days went from −$2,716.50 to +$228.50. The later breakouts made its gain. It never traded on a day the unfiltered script sat out.

TARGETDAYS LEFT WITHOUT A TRADETHEIR TRADES WITH NO FILTERDAYS WITH A LATER BREAKOUTTHOSE DAYS: NO FILTER → FILTER
1R28+$3,799.5017−$3,015 → −$431
1.5R28+$2,360.5017−$2,728.50 → +$348.50
2R28+$1,064.5017−$2,716.50 → +$228.50
3R28+$1,011.5017−$2,716.50 → +$602.50

The script as it ran

NQ 15-minute opening range with the 18:00 VWAP filter at 2R

The range is 9:30 to 9:45 New York. From 9:45 to 12:00 the first 5-minute close outside it enters. A long needs a close above the VWAP from 18:00 and a short a close below it. The stop sits at the range's other side and the target at twice the risk; one trade a day. Its VWAP filter input switches to Off or From 9:30.

Trades
472
Won
45.3%
Profit factor
1.05
Net
+6.2%
Worst drawdown
−14.6%
Worst trade
−$749

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

+$7,639.50 from 4 November 2024 to 23 February 2026, −$4,537 from 24 February 2026 to 22 October 2026.

Pine Script v6 · 81 linesRun this script
//@version=6
// Suggested timeframe: 5-minute
strategy("NQ Opening Range Breakout with a VWAP filter", 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 the target, all on New York's clock
orSess    = input.session("0930-0945", "Opening range (New York)")
tradeSess = input.session("0945-1200", "Entry window (New York)")
rMult     = input.float(2.0, "Target (R)", minval=0.5, step=0.5)
vwapFrom  = input.string("From 18:00", "VWAP filter", options=["Off", "From 18:00", "From 9:30"])

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

// 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
if session.isfirstbar
    orHigh      := na
    orLow       := na
    tradesToday := 0

// The VWAP the filter reads: from the futures day's 18:00 New York open, or from 9:30 only
var float cumPV    = 0.0
var float cumV     = 0.0
var float cumPV930 = 0.0
var float cumV930  = 0.0
if session.isfirstbar
    cumPV    := 0.0
    cumV     := 0.0
    cumPV930 := 0.0
    cumV930  := 0.0
cumPV += hlc3 * volume
cumV  += volume
if not na(time(timeframe.period, "0930-1600", "America/New_York"))
    cumPV930 += hlc3 * volume
    cumV930  += volume
vwapDay = cumV > 0 ? cumPV / cumV : na
vwap930 = cumV930 > 0 ? cumPV930 / cumV930 : na
vwapNow = vwapFrom == "From 18:00" ? vwapDay : vwapFrom == "From 9:30" ? vwap930 : na
// Longs only above the VWAP and shorts only below it; with the filter off, both sides trade
longOk  = vwapFrom == "Off" or (not na(vwapNow) and close > vwapNow)
shortOk = vwapFrom == "Off" or (not na(vwapNow) and close < vwapNow)

// 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 longOk and orLow < close
    stopLevel   := orLow
    targetLevel := close + (close - orLow) * rMult
    strategy.entry("Long", strategy.long)
    strategy.exit("Long exit", from_entry="Long", stop=stopLevel, limit=targetLevel)
    tradesToday := tradesToday + 1
if canTrade and shortSetup and shortOk and orHigh > close
    stopLevel   := orHigh
    targetLevel := close - (orHigh - close) * rMult
    strategy.entry("Short", strategy.short)
    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)
plot(vwapNow, "VWAP", color=color.new(#3D69A8, 0), style=plot.style_linebr)

The opening range without a filter has its own study: NQ opening range breakout. A VWAP rule on its own is tested in the NQ VWAP strategy.

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 a VWAP filter improve the NQ opening range breakout?

It depends on the VWAP. On MNQ 5-minute bars from 4 November 2024 to 22 October 2026, a VWAP from the futures day's 18:00 New York open made $716.50 to $2,307.50 more over two years at 1.5R, 2R and 3R. At 1R it made $1,215.50 less. A VWAP from 9:30 never blocked a trade and changed nothing. None of the 12 runs made money from 24 February 2026 to 22 October 2026.

Which VWAP did the test use?

The test used two VWAPs in separate runs. One starts at the futures day's open at 18:00 New York and carries the overnight session. The other starts at the regular session's 9:30 open. Both weigh each 5-minute bar's average of high, low and close by its volume. With a filter on, a long needs a close above the VWAP and a short a close below it.

Why did the 9:30 VWAP change nothing?

In these two years it never blocked a breakout. The 9:30 VWAP averages the prices traded since 9:30, the range's own among them. Every close above the range high was above it too. Every close below the range low was below it. The 18:00 VWAP also carries the overnight session. Overnight prices can sit far from the morning's range.

Did the filter make the breakout profitable in 2026?

No. Every one of the 12 runs lost money from 24 February 2026 to 22 October 2026. At 2R the 18:00 filter lost $4,537 there and the unfiltered script $7,628. Both made money from 4 November 2024 to 23 February 2026.

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 it enters. There is one trade a day. The stop sits at the range's other side and the target at 1, 1.5, 2 or 3 times the risk. The position closes on the futures day's last bar if neither is hit. 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 VWAP filter is an input you can switch to Off or From 9:30. 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 25 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 25 November 2026.

Test your Pine Script freeFree account, no cardPaste your script