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提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。