PROTECTED SOURCE SCRIPT
Aggiornato PrismNorm (Rolling)

# PrismNorm (Rolling)
Overview
PrismNorm (Rolling) frames four series — VWMA, TWMA, TrueWMA, and a half-price line — over a fixed lookback window, with all series scaled by a chosen volatility measure. Each bar shows how far price has strayed from its rolling anchor, expressed in StdDev, MAD, ATR-scaled, or fixed-percent units.
How It Works
• Compute rolling Weighted Moving Averages over the last lookback bars:
— VWMA: volume-weighted HLC3
— TWMA: simple average of OHLC midpoint
— TrueWMA: TrueRange-weighted TrueMid average
• Anchor each series to its value lookback bars ago (first bar in window). The half-price series uses either close[lookback] or an SMA lagged by half the window.
• Calculate a volatility measure over volWindowLen = lookback × normMult bars:
— Std Dev of close
— MAD of close
— ATR averaged and scaled to approximate σ
— A fixed percent of the window’s anchor value
• Band width = volatility (or percent of anchor). Normalized output = (net move) ÷ (band width)
Inputs
Settings / Description
• Lookback Period (bars) / Bars used for rolling WMAs and as the anchor lookback
• Deviation Measure / Volatility method: Std Dev, MAD, ATR (scaled), or Percent
• Normalization Span (×Lookback) / Multiplier (1–10) to expand lookback into volatility window
• Percent Deviation (%) / When Percent mode is on, band width = this % of the anchor WMA (or price)
• Scale MAD to σ / Scale Mad by √(π/2) so it aligns with σ under Normal distribution
• Use MA Anchor for Price (½×) / Off: anchor = close[lookback]; On: anchor = SMA(close, lookback) shifted by half the lookback
Display
• Show Normalized VWMA
• Show Normalized TWMA
• Show Normalized TrueWMA
• Show Normalized Price (½×)
Tips & Use Cases
• Percent mode yields fixed-width bands, handy for identifying structural shifts without volatility scaling.
• Toggling the MA anchor smooths the reference point, reducing noise in price normalization.
References:
1. TrueWMA Description
## 1. TrueWMA: Volatility-Weighted Price Averaging
What Is TrueWMA?
TrueWMA weights each bar’s TrueMid (TrueRange midpoint) by its TrueRange, so high-volatility bars carry more influence. It blends price level and volatility into one moving average.
In short, it’s a *TrueRange-weighted TrueMid average*.
Pseudocode
// TWMA Example for Comparison
window_size = 50
OHLC = (Open + High + Low + Close) / 4
TWMA = MA(OHLC, window_size)
// VWMA Example for Comparison
window_size = 50
HLC3 = (High + Low + Close) / 3
VWMA = Sum(HLC3 * Volume, window_size) / Sum(Volume, window_size)
// TrueWMA (Rolling)
window_size = 50
max_val = Maximum(Close[-1], High) // TrueRange High
min_val = Minimum(Close[-1], Low) // TrueRange Low
true_mid = (max_val + min_val) / 2 // TrueMid
TrueWMA = Sum(true_mid * TrueRange, window_size) / Sum(TrueRange, window_size)
Interpretation
For each bar, Rolling TrueWMA:
• Computes a TrueMid (“contextual midpoint”) from the prior close and the current bar’s high/low.
• Weights each TrueMid by that bar’s TrueRange.
• Divides the sum of those weighted midpoints by the total TrueRange over the lookback window.
The result is a single series that dynamically blends price levels with recent volatility.
Overview
PrismNorm (Rolling) frames four series — VWMA, TWMA, TrueWMA, and a half-price line — over a fixed lookback window, with all series scaled by a chosen volatility measure. Each bar shows how far price has strayed from its rolling anchor, expressed in StdDev, MAD, ATR-scaled, or fixed-percent units.
How It Works
• Compute rolling Weighted Moving Averages over the last lookback bars:
— VWMA: volume-weighted HLC3
— TWMA: simple average of OHLC midpoint
— TrueWMA: TrueRange-weighted TrueMid average
• Anchor each series to its value lookback bars ago (first bar in window). The half-price series uses either close[lookback] or an SMA lagged by half the window.
• Calculate a volatility measure over volWindowLen = lookback × normMult bars:
— Std Dev of close
— MAD of close
— ATR averaged and scaled to approximate σ
— A fixed percent of the window’s anchor value
• Band width = volatility (or percent of anchor). Normalized output = (net move) ÷ (band width)
Inputs
Settings / Description
• Lookback Period (bars) / Bars used for rolling WMAs and as the anchor lookback
• Deviation Measure / Volatility method: Std Dev, MAD, ATR (scaled), or Percent
• Normalization Span (×Lookback) / Multiplier (1–10) to expand lookback into volatility window
• Percent Deviation (%) / When Percent mode is on, band width = this % of the anchor WMA (or price)
• Scale MAD to σ / Scale Mad by √(π/2) so it aligns with σ under Normal distribution
• Use MA Anchor for Price (½×) / Off: anchor = close[lookback]; On: anchor = SMA(close, lookback) shifted by half the lookback
Display
• Show Normalized VWMA
• Show Normalized TWMA
• Show Normalized TrueWMA
• Show Normalized Price (½×)
Tips & Use Cases
• Percent mode yields fixed-width bands, handy for identifying structural shifts without volatility scaling.
• Toggling the MA anchor smooths the reference point, reducing noise in price normalization.
References:
1. TrueWMA Description
## 1. TrueWMA: Volatility-Weighted Price Averaging
What Is TrueWMA?
TrueWMA weights each bar’s TrueMid (TrueRange midpoint) by its TrueRange, so high-volatility bars carry more influence. It blends price level and volatility into one moving average.
In short, it’s a *TrueRange-weighted TrueMid average*.
Pseudocode
// TWMA Example for Comparison
window_size = 50
OHLC = (Open + High + Low + Close) / 4
TWMA = MA(OHLC, window_size)
// VWMA Example for Comparison
window_size = 50
HLC3 = (High + Low + Close) / 3
VWMA = Sum(HLC3 * Volume, window_size) / Sum(Volume, window_size)
// TrueWMA (Rolling)
window_size = 50
max_val = Maximum(Close[-1], High) // TrueRange High
min_val = Minimum(Close[-1], Low) // TrueRange Low
true_mid = (max_val + min_val) / 2 // TrueMid
TrueWMA = Sum(true_mid * TrueRange, window_size) / Sum(TrueRange, window_size)
Interpretation
For each bar, Rolling TrueWMA:
• Computes a TrueMid (“contextual midpoint”) from the prior close and the current bar’s high/low.
• Weights each TrueMid by that bar’s TrueRange.
• Divides the sum of those weighted midpoints by the total TrueRange over the lookback window.
The result is a single series that dynamically blends price levels with recent volatility.
Note di rilascio
# PrismNorm (Rolling)Overview
PrismNorm (Rolling) frames four series — VWMA, TWMA, TrueWMA, and a half-price line — over a fixed lookback window, with all series scaled by a chosen volatility measure. Each bar shows how far price has strayed from its rolling anchor, expressed in StdDev, MAD, ATR-scaled, or fixed-percent units.
How It Works
• Compute rolling Weighted Moving Averages over the last lookback bars:
— VWMA: volume-weighted HLC3
— TWMA: simple average of OHLC midpoint
— TrueWMA: TrueRange-weighted TrueMid average
• Anchor each series to its value lookback bars ago (first bar in window). The half-price series uses either close[lookback] or an SMA lagged by half the window.
• Calculate a volatility measure over volWindowLen = lookback × normMult bars:
— Std Dev of close
— MAD of close (scaled to σ)
— ATR averaged and scaled to approximate σ
— A fixed percent of the window’s anchor value
• Band width = volatility (or percent of anchor). Normalized output = (net move) ÷ (band width)
Inputs
Settings / Description
• Lookback Period (bars) / Bars used for rolling WMAs and as the anchor lookback
• Deviation Measure / Volatility method: Std Dev, MAD (scaled), ATR (scaled), or Percent
• Normalization Span (×Lookback) / Multiplier (1–10) to expand lookback into volatility window
• Percent Deviation (%) / When Percent mode is on, band width = this % of the anchor WMA (or price)
• Scale MAD to σ / Scale Mad by √(π/2) so it aligns with σ under Normal distribution
• Use MA Anchor for Price (½×) / Off: anchor = close[lookback]; On: anchor = SMA(close, lookback) shifted by half the lookback
Display
• Show Normalized VWMA
• Show Normalized TWMA
• Show Normalized TrueWMA
• Show Normalized Price (½×)
Tips & Use Cases
• Percent mode yields fixed-width bands, handy for identifying structural shifts without volatility scaling.
• Toggling the MA anchor smooths the reference point, reducing noise in price normalization.
References:
1. TrueWMA Description
## 1. TrueWMA: Volatility-Weighted Price Averaging
What Is TrueWMA?
TrueWMA weights each bar’s TrueMid (TrueRange midpoint) by its TrueRange, so high-volatility bars carry more influence. It blends price level and volatility into one moving average.
In short, it’s a *TrueRange-weighted TrueMid average*.
Pseudocode
// TWMA Example for Comparison
window_size = 50
OHLC = (Open + High + Low + Close) / 4
TWMA = MA(OHLC, window_size)
// VWMA Example for Comparison
window_size = 50
HLC3 = (High + Low + Close) / 3
VWMA = Sum(HLC3 * Volume, window_size) / Sum(Volume, window_size)
// TrueWMA (Rolling)
window_size = 50
max_val = Maximum(Close[-1], High) // TrueRange High
min_val = Minimum(Close[-1], Low) // TrueRange Low
true_mid = (max_val + min_val) / 2 // TrueMid
TrueWMA = Sum(true_mid * TrueRange, window_size) / Sum(TrueRange, window_size)
Interpretation
For each bar, Rolling TrueWMA:
• Computes a TrueMid (“contextual midpoint”) from the prior close and the current bar’s high/low.
• Weights each TrueMid by that bar’s TrueRange.
• Divides the sum of those weighted midpoints by the total TrueRange over the lookback window.
The result is a single series that dynamically blends price levels with recent volatility.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.