OPEN-SOURCE SCRIPT
HAP + Sniper Combined

trend regime filtering with normalized price positioning.
The first component, the EMA Cage, is built using three exponential moving averages (14, 50, and 100 periods). It defines dynamic trend zones based on the relative alignment of short, medium, and long-term EMAs. When the EMAs are aligned upward or downward, the structure highlights directional trend phases through adaptive coloring and band visualization.
The second component, the Sniper Band, transforms price behavior into normalized oscillatory values using both range-based and mean-reversion calculations. It compares short-term price distribution against a smoothed percentage deviation from a moving average. These two normalized signals are then mapped back onto the price scale to create a structured dual-band system.
The interaction between these two lines defines market state:
When both normalized components converge closely, it indicates equilibrium or compression zones.
When separation increases, it reflects directional expansion and trend development.
Color transitions represent relative dominance between the two normalized measures.
This combined structure is designed to visualize both trend direction (EMA Cage) and internal price pressure (Sniper Band) within the same framework, enabling clearer identification of market phases such as consolidation, expansion, and directional bias shifts.
The first component, the EMA Cage, is built using three exponential moving averages (14, 50, and 100 periods). It defines dynamic trend zones based on the relative alignment of short, medium, and long-term EMAs. When the EMAs are aligned upward or downward, the structure highlights directional trend phases through adaptive coloring and band visualization.
The second component, the Sniper Band, transforms price behavior into normalized oscillatory values using both range-based and mean-reversion calculations. It compares short-term price distribution against a smoothed percentage deviation from a moving average. These two normalized signals are then mapped back onto the price scale to create a structured dual-band system.
The interaction between these two lines defines market state:
When both normalized components converge closely, it indicates equilibrium or compression zones.
When separation increases, it reflects directional expansion and trend development.
Color transitions represent relative dominance between the two normalized measures.
This combined structure is designed to visualize both trend direction (EMA Cage) and internal price pressure (Sniper Band) within the same framework, enabling clearer identification of market phases such as consolidation, expansion, and directional bias shifts.
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.