OPEN-SOURCE SCRIPT
Dealing Range Equilibrium & Premium/Discount Zones (SMC)

This indicator is a streamlined visualization tool designed specifically for traders utilizing Smart Money Concepts (SMC) and ICT methodologies. It automatically detects the current structural Dealing Range and divides it into logical quadrants: Premium, Discount, and Equilibrium.
Rather than manually drawing Fibonacci grids on every new structural swing, this script dynamically anchors to the most recent validated pivot points, keeping your charts clean and your focus on price action.
Underlying Logic & Calculations
The script relies on a standard pivot-detection algorithm to establish the boundaries of the dealing range:
Swing Detection: It uses standard ta.pivothigh and ta.pivotlow functions to scan for structural highs and lows based on a user-defined "Swing Lookback Period" (default is 20 bars). A pivot high is confirmed when the central candle is higher than the n candles to its left and right.
Range Anchoring: Once a new swing high or low is validated, the top or bottom variables update respectively. These horizontal levels persist forward in time until a new structural pivot breaks them.
Equilibrium Calculation: The script calculates the mathematical median of the current range by adding the active Swing High and Swing Low, then dividing by two (top + bottom) / 2.
Visuals & Practical Usage
In SMC theory, markets move from consolidation to expansion, seeking liquidity. The dealing range helps traders contextualize where price is relative to recent structure:
Premium Zone (Red Fill): The upper 50% of the dealing range. In a bearish structural environment, traders look for price to retrace into the Premium zone to identify high-probability short setups or institutional distribution.
Discount Zone (Green Fill): The lower 50% of the dealing range. In a bullish environment, traders wait for price to retrace into the Discount zone to look for long setups or institutional accumulation.
Equilibrium (Midline): The exact 50% level (fair value). Price action around this line often acts as a transition point or near-term support/resistance.
Settings
Swing Lookback Period: Controls the sensitivity of the pivot detection. A lower number (e.g., 5 or 10) will capture micro-structure and minor pullbacks, ideal for scalping. A higher number (e.g., 20 or 50) will anchor only to major macro-swings.
Show Labels: Toggles the text labels on the current price axis to keep the chart clean if desired.
Rather than manually drawing Fibonacci grids on every new structural swing, this script dynamically anchors to the most recent validated pivot points, keeping your charts clean and your focus on price action.
Underlying Logic & Calculations
The script relies on a standard pivot-detection algorithm to establish the boundaries of the dealing range:
Swing Detection: It uses standard ta.pivothigh and ta.pivotlow functions to scan for structural highs and lows based on a user-defined "Swing Lookback Period" (default is 20 bars). A pivot high is confirmed when the central candle is higher than the n candles to its left and right.
Range Anchoring: Once a new swing high or low is validated, the top or bottom variables update respectively. These horizontal levels persist forward in time until a new structural pivot breaks them.
Equilibrium Calculation: The script calculates the mathematical median of the current range by adding the active Swing High and Swing Low, then dividing by two (top + bottom) / 2.
Visuals & Practical Usage
In SMC theory, markets move from consolidation to expansion, seeking liquidity. The dealing range helps traders contextualize where price is relative to recent structure:
Premium Zone (Red Fill): The upper 50% of the dealing range. In a bearish structural environment, traders look for price to retrace into the Premium zone to identify high-probability short setups or institutional distribution.
Discount Zone (Green Fill): The lower 50% of the dealing range. In a bullish environment, traders wait for price to retrace into the Discount zone to look for long setups or institutional accumulation.
Equilibrium (Midline): The exact 50% level (fair value). Price action around this line often acts as a transition point or near-term support/resistance.
Settings
Swing Lookback Period: Controls the sensitivity of the pivot detection. A lower number (e.g., 5 or 10) will capture micro-structure and minor pullbacks, ideal for scalping. A higher number (e.g., 20 or 50) will anchor only to major macro-swings.
Show Labels: Toggles the text labels on the current price axis to keep the chart clean if desired.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。