OPEN-SOURCE SCRIPT
Diupdate Bex DR

Bex DR/IDR is a professional Defining Range (DR) and Initial Defining Range (IDR) indicator for session-based traders.
Features:
• Regular, After-hours, and Overnight DR/IDR sessions
• Dynamic STD expansion levels
• Automatic DR body break detection
• Candle highlighting for breakout confirmation
• Configurable session ranges and extensions
• Optimized Pine Script v6 implementation
• Built for futures, forex, indices, gold, and crypto traders
The indicator helps identify:
• Session ranges
• Expansion targets
• Breakout confirmations
• Market structure shifts
• Intraday liquidity movements
Best suited for:
• ICT / SMC traders
• Futures traders
• NY session traders
• Scalpers and intraday traders
Features:
• Regular, After-hours, and Overnight DR/IDR sessions
• Dynamic STD expansion levels
• Automatic DR body break detection
• Candle highlighting for breakout confirmation
• Configurable session ranges and extensions
• Optimized Pine Script v6 implementation
• Built for futures, forex, indices, gold, and crypto traders
The indicator helps identify:
• Session ranges
• Expansion targets
• Breakout confirmations
• Market structure shifts
• Intraday liquidity movements
Best suited for:
• ICT / SMC traders
• Futures traders
• NY session traders
• Scalpers and intraday traders
Catatan Rilis
## New in This Update- Added **DR/IDR body break detection** for session ranges.
- Highlights the **first valid body-break candle only** per session.
- Added **bullish and bearish break labels** with directional markers.
- Break detection now works using the **active session’s IDR levels** instead of previous session levels.
- Breaks are detected only during the **session extension period**.
- Added logic to prevent multiple break signals within the same session.
- Historical clutter reduced by showing break markers only for the **current trading day**.
- Improved session-based reset handling for cleaner real-time tracking.
- Added customizable bullish/bearish break colors in settings.
---
## Visual Improvements
- Cleaner chart appearance with simplified directional arrows.
- Better distinction between bullish and bearish body-break candles.
- Reduced unnecessary repeated highlights inside the same range.
---
## Internal Improvements
- Optimized intraday handling and session-state tracking.
- Refined DR/IDR extension behavior for more accurate session continuation.
Catatan Rilis
Core Break Detection Overhaul- Independent Session Tracking: Break detection is no longer generalized. The script now individually tracks and stores the high and low of the Regular (RDR), After-hours (ADR), and Overnight (ODR) sessions upon their completion.
- New Break Condition (First Close): The break logic has transitioned from "Body Breaks" (open inside, close outside) to "First Close Beyond DR Level." It now specifically triggers when the current close breaks the session high/low while the previous close was at or within the range.
- Discrete Session States: Introduced isolated boolean flags for each session (e.g., adrBullBroken, odrBearBroken). Break states are now accurately reset at the end of each specific session rather than applying a global reset.
Visual & UI Adjustments
- Unified Break Coloring: Both bullish and bearish breakout candles and labels now utilize a unified purple identifier (color.rgb(70, 26, 146)), shifting away from the previous multi-color (purple/yellow/green) setup.
- Refined Labels: Breakout label sizes have been reduced from huge to normal for cleaner chart reading. (Note: The bearish label position was moved to track the high of the candle rather than the low).
- Hidden Indicator Inputs: All configuration inputs across Time Settings, General Settings, and Styles have been appended with display = display.none. This locks in the indicator's parameters and removes the clutter from the TradingView settings panel.
- Standard Deviation Lines: The showStdLines default state has been toggled from true to false.
- Data Window Plots: Added hidden plots for ADR, ODR, and RDR highs and lows. While hidden from the main chart visual (display = display.none), these levels are now accessible via the TradingView Data Window for precise value tracking.
Under the Hood
- Granular Variable Management: Deprecated the generic drHighBroken and drLowBroken variables in favor of dedicated stored variables (adrHigh, odrHigh, rdrStoredHigh, etc.) to prevent overlapping session data during extension periods.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.