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.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。