mod note:
The script takes raw price movement, removes trend and scale, converts it into a standardized Gaussian signal, and then smooths it without destroying its statistical shape.
What traders get is a clean, stable z‑score oscillator that behaves consistently across symbols, volatility regimes, and timeframes.
How to use it in practice
1. Identify statistical extremes
2. Track reversion toward the mean
3. Confirm trend exhaustion
4. Use the zero line as a regime boundary
This is not a trend indicator, but it helps define:
Why this indicator matters
You get a clean, mathematically honest representation of price deviation, which is rare in retail indicators.
The script takes raw price movement, removes trend and scale, converts it into a standardized Gaussian signal, and then smooths it without destroying its statistical shape.
What traders get is a clean, stable z‑score oscillator that behaves consistently across symbols, volatility regimes, and timeframes.
How to use it in practice
1. Identify statistical extremes
Values far above or below zero indicate standard‑deviation outliers.
Because the core is Gaussian‑preserving, these extremes are meaningful and comparable across markets.
+2 to +3 → statistically stretched upward
–2 to –3 → statistically stretched downward
These are not trade signals by themselves, but context flags for exhaustion or mean‑reversion setups.2. Track reversion toward the mean
When the oscillator rolls over from a high positive value or curls upward from a deep negative value, it often marks reversion phases.
This is especially useful for:
range‑bound markets
fading extended moves
timing exits on parabolic pushes
3. Confirm trend exhaustion
If price is making new highs but the Gaussian core is making lower highs, the standardized momentum is weakening.
Because the signal is normalized, this divergence is more reliable than raw‑price oscillators.
4. Use the zero line as a regime boundary
Crossing above zero indicates price has moved above its rolling mean.
Crossing below zero indicates price has moved below its rolling mean.
This is not a trend indicator, but it helps define:
bullish vs. bearish statistical regimes
early shifts in balance of pressure
confirmation for other signals (VWAP stretch, DSMA drift, etc.)
Why this indicator matters
Most oscillators distort the underlying distribution.
This one preserves maximum entropy, meaning:
no nonlinear compression
no artificial clipping
no skewing of tails
no distortion of variance
You get a clean, mathematically honest representation of price deviation, which is rare in retail indicators.
Code:
# =========================================
# Gaussian Maximum Entropy Preserver
# ver 04/AdeodatusTravelLink Series 2/2026
# =========================================
declare lower;
input length = 50;
input smoothLength = 10;
# --- Mean removal (center process)
def meanValue = Average(close, length);
def centeredValue = close - meanValue;
# --- Variance calculation
def varianceValue = Average(Sqr(centeredValue), length);
def stDevValue = Sqrt(varianceValue);
# --- Safe denominator (prevents divide-by-zero)
def stDevSafe = Max(stDevValue, 0.000001);
# --- Standardized Gaussian core
def zCore = centeredValue / stDevSafe;
# --- Linear smoothing (EMA is linear → preserves Gaussianity)
def smoothCore = ExpAverage(zCore, smoothLength);
# --- Plots
plot GaussianCore = smoothCore;
GaussianCore.SetDefaultColor(Color.CYAN);
GaussianCore.SetLineWeight(2);
plot ZeroLine = 0;
ZeroLine.SetDefaultColor(Color.GRAY);
ZeroLine.SetLineWeight(1);
Last edited by a moderator: