OPEN-SOURCE SCRIPT
Hemanth's Pure Z-Score Indicator

The Pure Z-Score Indicator is a statistical tool that measures how far the current price is from its recent average in terms of standard deviations. It helps traders identify overbought, oversold, and mean-reverting conditions in the market. This indicator is fully customizable, lightweight, and easy to use.
Key Features:
Displays the Z-Score of the price with optional smoothing.
Highlights overbought and oversold zones based on standard deviation thresholds.
Highlights mean (0) level for tracking price reversion.
Optional SMA or EMA smoothing to reduce noise.
Background highlights visually indicate extreme zones for easier analysis.
Inputs:
Length – Number of bars used to calculate the Z-Score.
Higher values smooth the indicator but react slower.
Lower values make it more sensitive but may produce more noise.
Overbought Level – Upper threshold for the Z-Score.
Default: 2.0 (2 standard deviations above the mean).
Crossing above this level signals a statistically overbought condition.
Oversold Level – Lower threshold for the Z-Score.
Default: -2.0 (2 standard deviations below the mean).
Crossing below this level signals a statistically oversold condition.
Use EMA instead of SMA – Determines whether the basis for Z-Score calculation is an Exponential Moving Average (EMA) or a Simple Moving Average (SMA).
EMA reacts faster to recent price changes.
SMA gives a smoother, slower-reacting average.
Smooth Z-Score (0 = no smoothing) – Apply additional smoothing to the Z-Score using a moving average.
Reduces noise and false spikes for cleaner visualization.
How to Use:
Overbought/Oversold: Watch for the Z-Score crossing the upper or lower levels to identify potential reversal zones.
Mean Reversion: Z-Score crossing the mean (0) can indicate short-term trend shifts.
Smoothing Options: Adjust the smoothing length and type to suit your trading style and timeframe.
Recommended Timeframes:
Works on any timeframe; suitable for day trading, swing trading, or longer-term analysis.
Best used in combination with price action or other indicators for confirmation.
Note:
This is a pure statistical indicator based on standard deviations. It does not provide buy/sell signals by itself, but helps traders identify areas of extreme price movement and potential reversals.
Key Features:
Displays the Z-Score of the price with optional smoothing.
Highlights overbought and oversold zones based on standard deviation thresholds.
Highlights mean (0) level for tracking price reversion.
Optional SMA or EMA smoothing to reduce noise.
Background highlights visually indicate extreme zones for easier analysis.
Inputs:
Length – Number of bars used to calculate the Z-Score.
Higher values smooth the indicator but react slower.
Lower values make it more sensitive but may produce more noise.
Overbought Level – Upper threshold for the Z-Score.
Default: 2.0 (2 standard deviations above the mean).
Crossing above this level signals a statistically overbought condition.
Oversold Level – Lower threshold for the Z-Score.
Default: -2.0 (2 standard deviations below the mean).
Crossing below this level signals a statistically oversold condition.
Use EMA instead of SMA – Determines whether the basis for Z-Score calculation is an Exponential Moving Average (EMA) or a Simple Moving Average (SMA).
EMA reacts faster to recent price changes.
SMA gives a smoother, slower-reacting average.
Smooth Z-Score (0 = no smoothing) – Apply additional smoothing to the Z-Score using a moving average.
Reduces noise and false spikes for cleaner visualization.
How to Use:
Overbought/Oversold: Watch for the Z-Score crossing the upper or lower levels to identify potential reversal zones.
Mean Reversion: Z-Score crossing the mean (0) can indicate short-term trend shifts.
Smoothing Options: Adjust the smoothing length and type to suit your trading style and timeframe.
Recommended Timeframes:
Works on any timeframe; suitable for day trading, swing trading, or longer-term analysis.
Best used in combination with price action or other indicators for confirmation.
Note:
This is a pure statistical indicator based on standard deviations. It does not provide buy/sell signals by itself, but helps traders identify areas of extreme price movement and potential reversals.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.