OPEN-SOURCE SCRIPT
更新済 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
リリースノート
## 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.
リリースノート
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.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。