OPEN-SOURCE SCRIPT

ORB with Range Context

1 036
📌 What This Indicator Does

This indicator plots the Opening Range (OR) — the high and low established during a user-defined session window at market open — and provides context on the range's significance by comparing it to recent volatility.

After the opening range session completes, the indicator displays:
• ORB High and Low as horizontal reference levels
• Optional Midline (often acts as intraday support/resistance)
• Target projections at customizable multiples when breakout occurs
• Range Quality classification (Narrow / Normal / Wide)


🔬 How It Works

Step 1: Opening Range Capture
During the session window (default: 09:15–09:20 IST for Indian markets), the indicator tracks the highest high and lowest low. These become the day's Opening Range boundaries.

Step 2: Range Quality Analysis
This is where this indicator differs from standard ORB tools. It compares today's range to the instrument's Average True Range (ATR) and classifies it:

• NARROW — Range is less than 0.5× ATR
Interpretation: Price compression. The market opened in a tight range relative to recent volatility. Compression often precedes expansion — breakouts from narrow ranges can be more directional.

• NORMAL — Range is between 0.5× and 1.2× ATR
Interpretation: Typical opening behavior. Standard breakout expectations apply.

• WIDE — Range is greater than 1.2× ATR
Interpretation: The market opened with unusual volatility — possibly due to gaps, news events, or overnight developments. Wide ranges may indicate that much of the day's move has already occurred.

Step 3: Breakout Detection
A breakout is confirmed when price closes beyond the ORB High or Low (not just wicks through). The indicator tracks the first breakout direction each day.

Step 4: Target Projection
On confirmed breakout, targets are calculated using the ORB range as the measurement unit:
• Target 1 = Breakout Level ± (Range × 1.0)
• Target 2 = Breakout Level ± (Range × 1.5)
• Target 3 = Breakout Level ± (Range × 2.0)


⚙️ Settings Guide

Opening Range Settings
• ORB Session Window — Time window for capturing the range. Default: 0915-0920 (first 5 min for NSE/BSE) or 0915-10:00(first 45 mins for NSE/BSE. US Markets: 0930-0935 or 0930-0945.
• Show Midline — Toggle the range midpoint display

Target Projection
• Target 1/2/3 (x Range) — Multipliers for profit targets. Default values (1.0, 1.5, 2.0) follow classical ORB methodology.

Range Quality Analysis
• ATR Period — Lookback for ATR calculation (default: 14)
• Narrow Threshold — Ranges below this ATR multiple are classified as narrow (default: 0.5)
• Wide Threshold — Ranges above this ATR multiple are classified as wide (default: 1.2)


📈 How to Use This Indicator

1. Apply to an intraday chart (1-min to 5-min recommended)
2. Wait for the ORB session to complete — levels appear after the time window ends
3. Check Range Quality in the info panel
4. Watch for breakout confirmation — price must close beyond ORB High or Low
5. Use projected targets for trade management


💡 Practical Tips

• Narrow Range Days: Often produce cleaner breakout trades. Tight opening suggests indecision that typically resolves directionally.

• Wide Range Days: If range exceeds 1.5× ATR, consider whether the instrument has already made its daily move.

• Midline Usage: After breakout, the midline often acts as a pullback level for re-entry or confirmation.


📊 Why Range Quality Matters

Most ORB indicators plot static levels without context. A 100-point range on NIFTY might be significant on a quiet day but trivial on a volatile day.

By normalizing against ATR, this indicator answers: "Is today's opening range tight or loose relative to what this instrument normally does?"

This helps traders:
• Calibrate profit expectations
• Assess risk appropriately
• Avoid mechanical trading without market context


🔔 Alerts Available
• ORB Bullish Breakout
• ORB Bearish Breakout
• Target 1 Hit
• Target 2 Hit


⚠️ Notes
• Works on intraday timeframes only
• Best suited for liquid instruments with defined opening sessions
• Range Quality is contextual guidance, not a standalone signal
• Always use appropriate risk management

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.