OPEN-SOURCE SCRIPT
Normalized SPMA | NAL

1. Overview
Normalized SPMA | NAL is a selective trend-regime oscillator built around the Shock Percentile Moving Average (SPMA) concept.
Unlike a conventional moving average that continuously absorbs every new bar, SPMA is deliberately selective. It evaluates current price movement relative to its own historical distribution and only allows qualifying movements to update the underlying baseline.
Normalized SPMA takes this concept further by expressing the relationship between price and the selective baseline in normalized form, then combining it with a volatility-adjusted boundary.
The result is a compact regime model designed to distinguish meaningful directional structure from lower-impact market movement.
2. Shock Percentile Moving Average
The foundation of the indicator is its percentile-gated moving average.
Current price change is ranked against a configurable historical window:
Pine Script®
Rather than updating continuously, the SPMA only accepts a new EMA value when the percentile condition is satisfied. Otherwise, its previous value is retained.
Pine Script®
This creates a form of selective memory: ordinary movement can leave the baseline unchanged, while sufficiently significant positive price events are allowed to reshape it.
3. Normalized Regime Structure
The SPMA is then normalized relative to current price, allowing the model to study the relationship between the selective baseline and the market on a proportional scale.
A rolling standard-deviation component is applied to this normalized structure, creating a second volatility-sensitive series.
Pine Script®
The interaction between these two measurements and the normalized reference level forms the final regime logic.
This combination is what gives Normalized SPMA its distinctive character: event-selective trend memory combined with normalized volatility structure.
4. Key Features
5. Purpose
Normalized SPMA was developed to explore a simple idea:
What happens when a trend model is allowed to remember important movement while becoming selectively insensitive to everything else?
By combining percentile-based event selection, adaptive baseline memory, normalization and volatility analysis, the indicator provides a different perspective on directional market structure than a continuously updating moving average.
It is intentionally compact, but the underlying interaction between selectivity, memory, normalization and volatility can produce a remarkably clean representation of changing market regimes.
Normalized SPMA | NAL is provided free and open source for research, experimentation and further study.
Normalized SPMA | NAL is a selective trend-regime oscillator built around the Shock Percentile Moving Average (SPMA) concept.
Unlike a conventional moving average that continuously absorbs every new bar, SPMA is deliberately selective. It evaluates current price movement relative to its own historical distribution and only allows qualifying movements to update the underlying baseline.
Normalized SPMA takes this concept further by expressing the relationship between price and the selective baseline in normalized form, then combining it with a volatility-adjusted boundary.
The result is a compact regime model designed to distinguish meaningful directional structure from lower-impact market movement.
2. Shock Percentile Moving Average
The foundation of the indicator is its percentile-gated moving average.
Current price change is ranked against a configurable historical window:
Rather than updating continuously, the SPMA only accepts a new EMA value when the percentile condition is satisfied. Otherwise, its previous value is retained.
This creates a form of selective memory: ordinary movement can leave the baseline unchanged, while sufficiently significant positive price events are allowed to reshape it.
3. Normalized Regime Structure
The SPMA is then normalized relative to current price, allowing the model to study the relationship between the selective baseline and the market on a proportional scale.
A rolling standard-deviation component is applied to this normalized structure, creating a second volatility-sensitive series.
The interaction between these two measurements and the normalized reference level forms the final regime logic.
This combination is what gives Normalized SPMA its distinctive character: event-selective trend memory combined with normalized volatility structure.
4. Key Features
- Percentile-Gated Trend Filtering
- Selective Market Memory
- Price Normalization
- Volatility-Adjusted Confirmation
- Persistent Regime State
- Colored Candles and Clear Visualization
5. Purpose
Normalized SPMA was developed to explore a simple idea:
What happens when a trend model is allowed to remember important movement while becoming selectively insensitive to everything else?
By combining percentile-based event selection, adaptive baseline memory, normalization and volatility analysis, the indicator provides a different perspective on directional market structure than a continuously updating moving average.
It is intentionally compact, but the underlying interaction between selectivity, memory, normalization and volatility can produce a remarkably clean representation of changing market regimes.
Normalized SPMA | NAL is provided free and open source for research, experimentation and further study.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
🔵 Access our best trading & investing tools, get a 30-day free trial today: whop.com/nordic-alpha-lab/
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
🔵 Access our best trading & investing tools, get a 30-day free trial today: whop.com/nordic-alpha-lab/
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。