OPEN-SOURCE SCRIPT
Custom Opening Range + STDV

📊 Custom Opening Range + STDV by GRCtrader
=== OVERVIEW ===
A flexible, professional-grade opening range analysis tool for any market session. Unlike fixed-time tools, this indicator lets you define the exact opening range start time (hour and minute), making it perfect for forex, crypto, indices, and alternative trading sessions. Automatically visualizes the opening range, center encroachment, and standard deviation extensions across multiple timeframes.
=== KEY FEATURES ===
✓ Custom Opening Range Time
- Define ANY start hour and minute (0-23 hours, 0-59 minutes)
- Perfect for 9:30 AM (US futures), London 08:00, Asian open, or any session
- Timezone offset adjustment for regional traders (ET, CT, PT, etc.)
- COMEX auto-detection for gold, silver, and other commodities
✓ Dynamic Opening Range Framework
- High/Low lines from your custom session start
- Center Encroachment (C.E.) midpoint for directional bias
- Multi-session historical tracking (configurable 1-20 sessions)
- Real-time label updates showing exact session times
✓ Extended Standard Deviation Bands
- Base STDV: 0.5, 1.0, 1.5, 2.0, 2.5 (always enabled)
- Extended STDV: 3.0, 3.5, 4.0, 4.5 (toggle via settings)
- Scales dynamically with opening range size
- Clean styling: solid, dotted, or dashed lines
✓ Intelligent Session Detection
- 30-minute bar analysis for accurate range capture
- Zero lag structure detection
- Duplicate session filtering
- Scales to any timeframe without distortion
=== USE CASES ===
• Forex Traders: London 08:00 open, Asian 00:00 open, NY 09:30 session
• Crypto Traders: Binance 00:00 UTC, custom exchange openings
• Commodity Traders: COMEX gold/silver opens, ICE energy sessions
• Stock Traders: Market open 09:30 ET, pre-market analysis
• Multi-Market Analysis: Compare opening range behavior across sessions
• Range Traders: Fade breaks, trade C.E. bounces on any opening
• Volatility Hunters: Extended STDV targets for breakout traders
=== SETTINGS ===
Opening Range Start Time:
• Opening Range Hour (0-23): Set the session hour
• Opening Range Minute (0-59): Set the session minute
• Example: 9:30 = "9" and "30" for US market open
Timezone & Market Detection:
• Futures Timezone Offset: Align charts to ET (-1 for CT, -2 for MT, -3 for PT)
• Auto-detects COMEX (GC, SI) for proper timezone handling
Display Options:
• Number of Opening Ranges: Show 1-20 historical sessions
• Show Opening Range: Toggle OR high/low lines
• Show Center Encroachment: Toggle C.E. midpoint line
• Show STDV Lines: Toggle all standard deviation bands
• Show Extended 3.0–4.5 STDV: Add extended targets for aggressive trades
Styling:
• OR Line Width & Color: Customize opening range visualization
• C.E. Line Width & Color: Customize center encroachment
• STDV Color, Width, Style: Choose solid/dotted/dashed lines
• STDV Labels: Toggle labels for clean chart (especially useful on crowded timeframes)
• Label Size: Tiny, small, normal, large
=== TECHNICAL DETAILS ===
Built on Pine Script v6 with:
- Efficient 30-minute bar data fetching via request.security()
- Dynamic time detection in America/New_York timezone reference
- Flexible offset adjustment for regional markets
- Smart line/label management (500 lines, 500 labels max)
- Full customization via Settings panel
- Zero repainting on bar close
=== OPEN SOURCE ===
This indicator is published as an open-source tool. Feel free to:
- Fork, modify, and redistribute for personal use
- Build derivatives and extended tools (multi-session comparisons, custom alerts, etc.)
- Share improvements with the community
- Use commercially with attribution
MPL 2.0 License: mozilla.org/MPL/2.0/
=== TIPS ===
• For 9:30 AM ET futures: Hour = 9, Minute = 30, Offset = 1 (or 0 for COMEX)
• For London 08:00: Hour = 8, Minute = 0, Offset = 5 (adjust based on chart timezone)
• For 00:00 UTC (crypto): Hour = 0, Minute = 0, Offset adjusted to UTC reference
• Extended STDV is useful for swing traders; day traders typically use base 0.5–2.5 range
• Reduce label size on lower timeframes to avoid chart clutter
=== DISCLAIMER ===
This tool is for analysis and education purposes. Past performance does not guarantee future results. Always use proper risk management, position sizing, and confirm signals with your trading strategy. No financial advice is implied.
=== CREDITS ===
GRCTrader | Built for traders, by traders | Open source for the community
=== OVERVIEW ===
A flexible, professional-grade opening range analysis tool for any market session. Unlike fixed-time tools, this indicator lets you define the exact opening range start time (hour and minute), making it perfect for forex, crypto, indices, and alternative trading sessions. Automatically visualizes the opening range, center encroachment, and standard deviation extensions across multiple timeframes.
=== KEY FEATURES ===
✓ Custom Opening Range Time
- Define ANY start hour and minute (0-23 hours, 0-59 minutes)
- Perfect for 9:30 AM (US futures), London 08:00, Asian open, or any session
- Timezone offset adjustment for regional traders (ET, CT, PT, etc.)
- COMEX auto-detection for gold, silver, and other commodities
✓ Dynamic Opening Range Framework
- High/Low lines from your custom session start
- Center Encroachment (C.E.) midpoint for directional bias
- Multi-session historical tracking (configurable 1-20 sessions)
- Real-time label updates showing exact session times
✓ Extended Standard Deviation Bands
- Base STDV: 0.5, 1.0, 1.5, 2.0, 2.5 (always enabled)
- Extended STDV: 3.0, 3.5, 4.0, 4.5 (toggle via settings)
- Scales dynamically with opening range size
- Clean styling: solid, dotted, or dashed lines
✓ Intelligent Session Detection
- 30-minute bar analysis for accurate range capture
- Zero lag structure detection
- Duplicate session filtering
- Scales to any timeframe without distortion
=== USE CASES ===
• Forex Traders: London 08:00 open, Asian 00:00 open, NY 09:30 session
• Crypto Traders: Binance 00:00 UTC, custom exchange openings
• Commodity Traders: COMEX gold/silver opens, ICE energy sessions
• Stock Traders: Market open 09:30 ET, pre-market analysis
• Multi-Market Analysis: Compare opening range behavior across sessions
• Range Traders: Fade breaks, trade C.E. bounces on any opening
• Volatility Hunters: Extended STDV targets for breakout traders
=== SETTINGS ===
Opening Range Start Time:
• Opening Range Hour (0-23): Set the session hour
• Opening Range Minute (0-59): Set the session minute
• Example: 9:30 = "9" and "30" for US market open
Timezone & Market Detection:
• Futures Timezone Offset: Align charts to ET (-1 for CT, -2 for MT, -3 for PT)
• Auto-detects COMEX (GC, SI) for proper timezone handling
Display Options:
• Number of Opening Ranges: Show 1-20 historical sessions
• Show Opening Range: Toggle OR high/low lines
• Show Center Encroachment: Toggle C.E. midpoint line
• Show STDV Lines: Toggle all standard deviation bands
• Show Extended 3.0–4.5 STDV: Add extended targets for aggressive trades
Styling:
• OR Line Width & Color: Customize opening range visualization
• C.E. Line Width & Color: Customize center encroachment
• STDV Color, Width, Style: Choose solid/dotted/dashed lines
• STDV Labels: Toggle labels for clean chart (especially useful on crowded timeframes)
• Label Size: Tiny, small, normal, large
=== TECHNICAL DETAILS ===
Built on Pine Script v6 with:
- Efficient 30-minute bar data fetching via request.security()
- Dynamic time detection in America/New_York timezone reference
- Flexible offset adjustment for regional markets
- Smart line/label management (500 lines, 500 labels max)
- Full customization via Settings panel
- Zero repainting on bar close
=== OPEN SOURCE ===
This indicator is published as an open-source tool. Feel free to:
- Fork, modify, and redistribute for personal use
- Build derivatives and extended tools (multi-session comparisons, custom alerts, etc.)
- Share improvements with the community
- Use commercially with attribution
MPL 2.0 License: mozilla.org/MPL/2.0/
=== TIPS ===
• For 9:30 AM ET futures: Hour = 9, Minute = 30, Offset = 1 (or 0 for COMEX)
• For London 08:00: Hour = 8, Minute = 0, Offset = 5 (adjust based on chart timezone)
• For 00:00 UTC (crypto): Hour = 0, Minute = 0, Offset adjusted to UTC reference
• Extended STDV is useful for swing traders; day traders typically use base 0.5–2.5 range
• Reduce label size on lower timeframes to avoid chart clutter
=== DISCLAIMER ===
This tool is for analysis and education purposes. Past performance does not guarantee future results. Always use proper risk management, position sizing, and confirm signals with your trading strategy. No financial advice is implied.
=== CREDITS ===
GRCTrader | Built for traders, by traders | Open source for the community
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.