Open-source

Z Score Overlay

A clean and effective Z-score overlay that visually tracks how far price deviates from its moving average. By standardizing price movements, this tool help...

Z Score Overlay preview
Published Jun 23, 2025
1,11522,104

What this TradingView script does

A clean and effective Z-score overlay that visually tracks how far price deviates from its moving average. By standardizing price movements, this tool helps traders understand when price is statistically extended or compressed—up to ±4 standard deviations. The built-in scale and real-time bin markers offer immediate context on where price stands in relation to its recent mean.

🔵 CONCEPTS

- Z Score Calculation:   Z = (Close − SMA) ÷ Standard Deviation   This formula shows how many standard deviations the current price is from its mean.

- Statistical Extremes:   • Z > +2 or Z < −2 suggests statistically significant deviation.   • Z near 0 implies price is close to its average.

- Standardization of Price Behavior: Makes it easier to compare volatility and overextension across timeframes and assets.

🔵 FEATURES

- Colored Z Line: Gradient coloring based on how far price deviates—   • Red = oversold (−4),   • Green = overbought (+4),   • Yellow = neutral (~0).

- Deviation Scale Bar: A vertical scale from −4 to +4 standard deviations plotted to the right of price.

- Active Z Score Bin: Highlights the current Z-score bin with a “◀” arrow

- Context Labels: Clear numeric labels for each Z-level from −4 to +4 along the side.

How traders can use it

Use Z Score Overlay as a chart context layer inside TradingView: read the structure it highlights, compare it with your market bias, and let the script narrow which moves deserve attention.

The strongest workflow is to combine the script with higher timeframe structure, volume context, and a repeatable execution plan instead of treating any single label as a standalone trade.

Ready to level up your trading?

Get advanced indicators, backtesting and the BigBeluga community in one plan.

Get Access