OPEN-SOURCE SCRIPT

MNQ ORB Strategy - VWAP + Bias

1 000
MNQ ORB Strategy
VWAP Filter + Directional Bias + Overnight Levels
TradingView Pine Script v5 Strategy | Micro E-mini Nasdaq Futures (MNQ)

─────────────────────────────────────────────────────────────────────

OVERVIEW

This strategy applies Opening Range Breakout (ORB) methodology to the Micro E-mini Nasdaq futures contract (MNQ). It combines a configurable ORB window with a VWAP directional filter, a directional bias control, and overnight high/low level plotting to give traders both systematic entry signals and meaningful market context at the regular session open.

The strategy is designed for backtesting and live execution on a 1-minute chart. All inputs are fully configurable so traders can test different ORB windows, tick-based profit targets and stop losses, and VWAP exit behavior without modifying the code.

─────────────────────────────────────────────────────────────────────

HOW IT WORKS

STEP 1 — OPENING RANGE FORMATION (9:30 to 9:40 ET default)

The strategy tracks every 1-minute bar between 9:30 and 9:40 AM Eastern Time, recording the highest high and lowest low of that window. At 9:40 the ORB is locked in for the day and does not change. Two levels are derived from the ORB:

- Buy Level: ORB High + buffer ticks — breakout level for longs
- Sell Level: ORB Low - buffer ticks — breakdown level for shorts

STEP 2 — VWAP FILTER

The VWAP filter prevents entries that conflict with the intraday trend. This is the most important filter in the strategy because index futures respect VWAP heavily — institutions use it as their primary execution benchmark throughout the session.

- Long entries only fire when price is above VWAP
- Short entries only fire when price is below VWAP
- The VWAP filter can be toggled off for backtesting without it

NOTE: If the ORB breaks but VWAP blocks the entry, the opportunity is marked as missed for the day. No re-entry is allowed after the initial breakout bar even if price later crosses VWAP. This prevents late, off-level entries that are a common source of poor fills in practice.

STEP 3 — FIRST DIRECTION LOCK

Once price breaks either the buy level or sell level, that direction is locked for the day. The opposite side cannot fire a signal after the first break. This prevents the common scenario where an instrument breaks one direction, reverses, and triggers a second trade in the opposite direction at a far worse price.

STEP 4 — DIRECTIONAL BIAS CONTROL

The bias dropdown allows traders to manually set the directional filter each morning based on their market analysis, stage analysis, or trend assessment:

- Both — strategy fires long and short signals (default)
- Long Only — only long breakouts above the ORB high are taken
- Short Only — only short breakdowns below the ORB low are taken

This is particularly useful for traders who use a broader market framework (stage analysis, macro trend, sector strength) to determine daily directional bias before the open. On strongly trending days, running the strategy in one direction only significantly reduces false signals.

STEP 5 — OVERNIGHT HIGH/LOW REFERENCE LEVELS

The strategy plots the overnight high and low (6pm prior day to 9:30am current day) as visual reference lines on the chart. These levels are not used in entry logic by default — they are provided as context for manual observation.

- Aqua line: overnight session high
- Fuchsia line: overnight session low

The info panel displays the opening context relative to the overnight range — whether price opened above the overnight high (bullish), below the overnight low (bearish), or inside the range (neutral). Traders can use this to inform their daily bias selection before the ORB window opens.

STEP 6 — EXIT MANAGEMENT

The strategy places OCO (one cancels other) exit orders immediately upon entry. Two exit modes are available:

- Standard TP/SL: fixed tick-based take profit and stop loss
- Trailing Stop: activates after price moves trail ticks in your favor,
then follows price dynamically with a hard stop as a
safety net

An optional VWAP cross exit can be enabled — this closes the position if price crosses back through VWAP against the trade direction. For longs, a cross below VWAP triggers a close. For shorts, a cross above VWAP triggers a close. This exit fires separately from the TP/SL and can reduce losses on failed breakouts significantly.

─────────────────────────────────────────────────────────────────────

INPUT REFERENCE

Input Default Group Description
─────────────────────────────────────────────────────────────────────
ORB Window (minutes) 10 ORB Settings Length of opening range window in minutes
Buffer (ticks) 4 ORB Settings Buffer added above ORB high and below ORB low
Contracts 2 Position Sizing Number of MNQ contracts per trade
Take Profit (ticks) 300 Risk Management Profit target in ticks from entry
Stop Loss (ticks) 150 Risk Management Stop loss in ticks from entry
Use Trailing Stop Off Risk Management Toggle trailing stop vs fixed TP/SL
Trailing Stop (ticks) 150 Risk Management Trailing stop distance once activated
Use ATR Filter On Filters Skip trade if ORB range exceeds ATR multiple
ATR Multiplier 1.5 Filters Max ORB range as multiple of 14-day ATR
Use VWAP Filter On Filters Long above VWAP only, short below VWAP only
Exit on VWAP Cross On Filters Close position if price crosses VWAP against trade
Trade Direction Both Bias Settings Both / Long Only / Short Only
Entry Window End 11 Session Settings Hour ET when new entries stop for the day
Show ORB Levels On Display Plot ORB high, low, buy and sell levels
Show VWAP On Display Plot VWAP line and background shading
Show Overnight Levels On Display Plot overnight high and low reference lines
Show Info Panel On Display On-chart label showing current settings and status

─────────────────────────────────────────────────────────────────────

TICK MATH REFERENCE

MNQ tick size: 0.25 points
Point value: $2.00 per contract
Tick value: $0.50 per contract

TP Ticks SL Ticks TP $ (2 contracts) SL $ (2 contracts)
─────────────────────────────────────────────────────────────────────
120 60 $120 $60
200 100 $200 $100
300 150 $300 $150
400 200 $400 $200

All configurations above maintain a 2:1 reward-to-risk ratio.
Break-even win rate at 2:1 R/R = 33.3%

─────────────────────────────────────────────────────────────────────

CHART VISUALS

- Blue line ORB High
- Red line ORB Low
- Lime line Buy Level (ORB High + buffer)
- Orange line Sell Level (ORB Low - buffer)
- Purple line VWAP
- Green background Price above VWAP (long bias)
- Red background Price below VWAP (short bias)
- Aqua dashed Overnight session high
- Fuchsia dashed Overnight session low
- Green triangle Long signal fired
- Red triangle Short signal fired
- Yellow X Breakout occurred but VWAP blocked entry
(entry missed for the day — no re-entry)

─────────────────────────────────────────────────────────────────────

INFO PANEL

The on-chart info panel displays real-time strategy status:

- Current bias mode
- Contracts and dollar value of TP and SL
- ORB range in ticks
- ATR filter status (PASS or FAIL)
- VWAP side (ABOVE or BELOW)
- Overnight context (opened above, below, or inside overnight range)
- Whether long or short entry was missed due to VWAP filter
- Whether the entry window is currently open

─────────────────────────────────────────────────────────────────────

BACKTESTING GUIDE

CHART SETUP
- Set chart to MNQ1! or the current active front month contract
- Set chart timeframe to 1 MINUTE — only timeframe that produces
accurate results
- Do not backtest on 5, 10, or 15 minute charts — signal detection
will be delayed and fills will be unrealistic

STRATEGY TESTER SETTINGS
- Commission: $0.35 per contract per side or $0.00 for comparison
- Slippage: 1-2 ticks to simulate realistic market order fills
- Capital: set to your intended trading capital

SUGGESTED TEST MATRIX
ORB Window TP Ticks SL Ticks VWAP Filter VWAP Exit
─────────────────────────────────────────────────────────────────────
5 min 120 60 On On
10 min 120 60 On On
10 min 300 150 On On
10 min 300 150 On Off
15 min 300 150 On On
10 min 300 150 Off Off

─────────────────────────────────────────────────────────────────────

TRADERSPOST INTEGRATION

TradingView alert setup:
- Condition: MNQ ORB Strategy - VWAP + Bias
→ alert() function calls only
- Message: {{strategy.order.alert_message}}
- Webhook URL: your TradersPost strategy webhook URL
- Trigger: Once Per Bar Close

Three alert types are sent:
- Buy signal: entry long with quantity
- Sell signal: entry short with quantity
- Exit signal: closes open position when TP, SL, or VWAP cross fires

NOTE: TP and SL are managed by TradingView strategy exits, not by
TradersPost. Configure your TradersPost strategy subscription to not
override exit orders.

─────────────────────────────────────────────────────────────────────

IMPORTANT NOTES

- This strategy is for MNQ futures only. Do not apply to stocks or
other instruments without modification.
- Always paper trade before going live.
- Overnight range plots require extended hours data enabled on your
TradingView plan.
- Entry window closes at 11:00 AM ET by default. Adjust the Entry
Window End input to test different cutoff times.
- VWAP resets at 9:30 AM ET (regular session open). Extended hours
VWAP behavior may differ from your broker's display.

─────────────────────────────────────────────────────────────────────

DISCLAIMER

This strategy is provided for educational and backtesting purposes
only. It does not constitute financial advice. Trading futures involves
substantial risk of loss and is not appropriate for all investors.
Always paper trade any new strategy before committing real capital.
Past performance does not guarantee future results.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน