OPEN-SOURCE SCRIPT
Updated

NeuraEdge ORB - Opening Range Breakout Indicator

2 191
OVERVIEW
NeuraEdge ORB is an open-source Opening Range Breakout indicator that automates the classic 15-minute ORB strategy. The indicator tracks the first 15 minutes of market action (9:30-9:45 AM ET), identifies breakouts above or below this range, and generates trading signals with automated stop loss and take profit calculations.
The Opening Range Breakout concept is based on the observation that the initial price action after market open often establishes directional bias for the trading session, as institutional order flow and overnight gap reactions manifest during this window.
CORE METHODOLOGY
Opening Range Construction:
The indicator uses session-based time detection to identify the 9:30-9:45 AM Eastern Time window. During this period, it tracks the highest high and lowest low to establish the opening range boundaries. The range is marked complete when the 15-minute window closes.
Calculation process:

OR High = Maximum high value during the 15-minute window
OR Low = Minimum low value during the 15-minute window
OR Midpoint = (OR High + OR Low) / 2
Range Size = OR High - OR Low (compared to 14-period ATR for context)

Breakout Detection:
The indicator identifies breakouts using close-price confirmation to reduce false signals from wicks:

Bullish breakout: Close above OR High (with previous close at or below OR High)
Bearish breakout: Close below OR Low (with previous close at or above OR Low)

The indicator tracks whether each direction has already broken to prevent duplicate signals on the same range.
Entry Type Logic:
Two entry methodologies are supported:

Breakout Mode - Signals immediately upon range break. Enters on the breakout bar when close confirms direction.
Retest Mode - Waits for price to break the range, then pullback to touch the range level before entering. Cancels if price moves too far beyond midpoint. This provides better entry prices with tighter stop losses.

Volume Confirmation:
Optional volume filter compares current bar volume to 20-period simple moving average. Requires volume > 1.2x average to validate breakout strength and filter low-conviction moves.
Fair Value Gap (FVG) Integration:
Optional confluence filter that checks for unfilled FVG in the breakout direction:

Bullish FVG detected when: current bar's low > two bars ago high (creating gap)
Bearish FVG detected when: current bar's high < two bars ago low (creating gap)
Minimum FVG size: 0.3x ATR to filter noise
FVG considered filled when price retraces to gap midpoint

Signals only generate when an unfilled FVG exists in the breakout direction, adding institutional order flow confluence.
Risk Management Calculations:
Three stop loss placement methods:

Opposite Side - SL at opposite end of opening range (classic ORB approach)
Midpoint - SL at range midpoint (tighter risk, lower reward potential)
ATR Based - SL at 1.5x ATR from entry (adaptive to volatility)

Take profit calculated as: Entry ± (Entry - Stop Loss) × Risk:Reward Ratio
Default 1.5:1 R:R ratio, adjustable from 1.0 to 5.0.
Performance Tracking:
The indicator maintains a trade history using Pine Script's type system:

Records entry price, stop loss, take profit, and direction for each signal
Tracks outcome when price hits stop loss or take profit levels
Auto-closes after 80 bars if neither level hit
Calculates rolling win rate from last 50 trades maximum
Displays W/L record in real-time dashboard

VISUAL COMPONENTS
Opening Range Box:
Semi-transparent blue box drawn from range start bar to current bar + 20, showing the established range boundaries visually.
Range Levels:

Green line at OR High (potential long entry level)
Red line at OR Low (potential short entry level)
Gray dotted line at OR Midpoint (reference level)
All lines extend 50 bars forward for anticipation.

Trade Signals:

Green up arrow with "LONG ORB Break" label below price
Red down arrow with "SHORT ORB Break" label above price
Dashed lines showing SL and TP levels extending 30 bars
Small labels marking SL and TP endpoints

Real-Time Dashboard:
Top-right panel displaying:

OR formation status (Forming / Complete / Waiting)
Current OR High, Low, and Range size (with ATR multiple)
Breakout status (Long / Short / None)
Volume status (High / Normal)
FVG presence (Bull / Bear / None)
Entry settings (Breakout/Retest, R:R, SL type)
Win rate percentage and W/L record

PRACTICAL APPLICATION
Ideal Market Conditions:

Liquid instruments: SPY, QQQ, IWM, high-volume stocks
Recommended timeframes: 1-minute or 5-minute charts for precise entries
Most effective during trending days with clear directional bias
Range size between 0.5-1.5x ATR typically provides best risk:reward

Usage Workflow:

Apply indicator at market open (9:30 AM ET)
Observe range formation during first 15 minutes
Wait for "Complete" status in dashboard
Monitor for breakout signals with volume/FVG confirmation
Enter on signal, place stop loss and take profit as marked
Avoid taking opposing signals on same day (trend following approach)

Retest vs Breakout Selection:

Use Breakout mode on high-momentum days with strong overnight gaps
Use Retest mode on slower days or when seeking better entry prices
Retest mode reduces signal frequency but improves entry quality

Time-of-Day Considerations:
The indicator includes a trading cutoff setting (default 3:00 PM ET) to avoid late-day chop and reduced liquidity. First-hour breakouts (10:00-11:00 AM) historically show strongest follow-through.
SETTINGS & CUSTOMIZATION
Display Options:

Toggle signals, opening range box, and dashboard independently
Clean visual design to reduce chart clutter

Opening Range Settings:

Opening range duration (5-60 minutes in 5-minute increments)
Default 15 minutes aligns with classic ORB methodology
Trading cutoff hour (10-16, representing 10:00 AM - 4:00 PM ET)

Entry Configuration:

Entry type (Breakout / Retest)
Volume confirmation toggle (requires 1.2x average volume)
FVG confluence toggle (requires unfilled gap in breakout direction)

Risk Management:

Stop loss placement (Opposite Side / Midpoint / ATR Based)
Risk:reward ratio (1.0 - 5.0, default 1.5)
Future: Trail stop after partial TP (currently placeholder)

Alert System:
Five alert conditions available:

Opening Range Complete
ORB Long Signal
ORB Short Signal
Breakout Up (range broken, regardless of signal)
Breakout Down (range broken, regardless of signal)

BEST PRACTICES
Recommended Usage:

Focus on highly liquid instruments with tight spreads
Use 1-5 minute charts for entry precision
Respect calculated stop losses (range defines maximum risk)
Typically 1-2 quality setups per day maximum
Consider overall market trend (SPY/QQQ direction)

Risk Considerations:

Very small ranges (< 0.3x ATR) prone to false breakouts
Very large ranges (> 2x ATR) may indicate gap day requiring adjusted expectations
Low volume breakouts fail more frequently
Avoid trading both directions on same day (pick strongest setup)

IMPORTANT DISCLOSURES
This indicator is provided free and open-source for educational purposes. The Opening Range Breakout strategy is a well-documented public domain trading concept. This implementation adds automation, visual clarity, and optional confluence filters.
No indicator guarantees profitable trades. Past performance does not predict future results. Traders are responsible for their own trading decisions and risk management. Always use appropriate position sizing and never risk more than you can afford to lose.
Release Notes
New Update with additional features:
Best mode is Default Retest use the other modes as necessary.
Inverse ORB (Fade Mode):
  • When the opening range is unusually large, the script can trade the opposite move:
  • Short the OR High
  • Long the OR Low
  • Works well during range-bound markets.

Pre-empt ORB (Trend Mode)

  • Uses higher-timeframe EMA trend to identify directional bias.
  • Allows early entries near the OR edge before breakout confirmation
.

Volume Confirmation:

  • Signals can require above-average volume to filter weak breakouts.
  • EMA Trend Filter
  • Optional EMA filter to align trades with local trend direction.
  • VWAP Filter
  • Optional filter to ensure trades occur on the correct side of VWAP.
  • VWAP Deviation Bands
  • Optional volatility filter using VWAP standard deviation bands.


Added Time Zone selection for different trading sessions.
Release Notes
Fixed comments
Release Notes
Best mode is Default Retest. Test Various confluences to suite your style from settings.
Added :
->auto FVG confluence so the signal will show if the FVG is present as a bonus instead of selecting FVG separately.
->Historical Range marker
-> Better Accuracy
Fixed bug around Reverse ORB and EMA.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.