Shock Percentile Moving Average | NAL

1. Overview
Shock Percentile Moving Average | NAL is an event-driven trend filter designed to react selectively to unusually strong price movements.
Instead of updating continuously like a conventional moving average, the SPMA only refreshes when the current price change ranks high enough relative to recent returns. When that condition is not met, the moving average holds its previous value.
This creates a stepped adaptive baseline that places greater emphasis on meaningful price shocks while filtering out a large portion of lower-impact movement.
2. Calculation
The indicator begins by measuring the current one-bar price change.
Pine Script®
That return is then ranked against recent historical returns using a percentile rank.
Pine Script®
The percentile gate determines whether the baseline is allowed to update.
Pine Script®
When the return exceeds the selected percentile threshold, the SPMA updates to the current EMA value. When the threshold is not met, the previous SPMA value is retained.
Pine Script®
This means the baseline does not continuously follow every movement in price. Its structure changes primarily when the market produces sufficiently strong ranked shocks.
A second layer measures the percentage slope of the SPMA over a selected lookback.
Pine Script®
When the optional slope gate is enabled, a bullish regime requires both an upward SPMA movement and sufficient positive slope.
The bearish state remains based on downward movement in the SPMA.
Pine Script®
When neither directional condition is satisfied, the previous regime is retained.
3. Key Features
4. Use
Shock Percentile Moving Average is designed to isolate trend development that occurs around statistically stronger price movements.
Because the baseline only updates when the return percentile exceeds the selected gate, the SPMA can remain stable through lower-impact movement and reposition itself when more significant price shocks occur.
The optional slope gate adds another layer of selectivity by requiring the updated structure to demonstrate sufficient positive acceleration before establishing a bullish state.
SPMA is designed as a specialized structural component within a complete strategy framework. Its role is to isolate price movement associated with stronger ranked shocks and convert those events into a persistent directional baseline that can be incorporated into a broader market decision process.
Shock Percentile Moving Average | NAL is an event-driven trend filter designed to react selectively to unusually strong price movements.
Instead of updating continuously like a conventional moving average, the SPMA only refreshes when the current price change ranks high enough relative to recent returns. When that condition is not met, the moving average holds its previous value.
This creates a stepped adaptive baseline that places greater emphasis on meaningful price shocks while filtering out a large portion of lower-impact movement.
2. Calculation
The indicator begins by measuring the current one-bar price change.
That return is then ranked against recent historical returns using a percentile rank.
The percentile gate determines whether the baseline is allowed to update.
When the return exceeds the selected percentile threshold, the SPMA updates to the current EMA value. When the threshold is not met, the previous SPMA value is retained.
This means the baseline does not continuously follow every movement in price. Its structure changes primarily when the market produces sufficiently strong ranked shocks.
A second layer measures the percentage slope of the SPMA over a selected lookback.
When the optional slope gate is enabled, a bullish regime requires both an upward SPMA movement and sufficient positive slope.
The bearish state remains based on downward movement in the SPMA.
When neither directional condition is satisfied, the previous regime is retained.
3. Key Features
- Percentile-ranked return filtering.
- Event-driven moving average updates.
- Baseline remains unchanged during lower-ranked price movement.
- Configurable shock threshold and historical ranking window.
- Optional percentage-slope confirmation for bullish states.
- Persistent directional regime logic.
- State-based SPMA and candle coloring.
4. Use
Shock Percentile Moving Average is designed to isolate trend development that occurs around statistically stronger price movements.
Because the baseline only updates when the return percentile exceeds the selected gate, the SPMA can remain stable through lower-impact movement and reposition itself when more significant price shocks occur.
The optional slope gate adds another layer of selectivity by requiring the updated structure to demonstrate sufficient positive acceleration before establishing a bullish state.
SPMA is designed as a specialized structural component within a complete strategy framework. Its role is to isolate price movement associated with stronger ranked shocks and convert those events into a persistent directional baseline that can be incorporated into a broader market decision process.
🔵 Access our best trading & investing tools, get a 30-day free trial today: whop.com/nordic-alpha-lab/
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
🔵 Access our best trading & investing tools, get a 30-day free trial today: whop.com/nordic-alpha-lab/
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.