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.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.