OPEN-SOURCE SCRIPT

Normalized SPMA | NAL

710
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

  1. Percentile-Gated Trend Filtering
  2. Selective Market Memory
  3. Price Normalization
  4. Volatility-Adjusted Confirmation
  5. Persistent Regime State
  6. 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が提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。