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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.