OPEN-SOURCE SCRIPT
Updated Z Value Alert

Z Value Alert analyzes daily price movements by evaluating fluctuations relative to historical volatility. It calculates the daily percentage change in the closing price, the average of this change over 252 days, and the standard deviation. Using these values, a Z-Score is calculated, indicating how much the current price change deviates from the historical range of fluctuations.
The user can set a threshold in standard deviations (Z-Score). When the absolute Z-Score exceeds this threshold, a significant movement is detected, indicating increased volatility. The Z-Score is visualized as a histogram, and an alert can be triggered when a significant movement occurs.
The number of trading days used to calculate historical volatility is adjustable, allowing the Sigma Move Alert to be tailored to various trading strategies and analysis periods.
Additionally, a dropdown option for the calculation method is available in the input menu, allowing the user to select between:
Normal: Calculates the percentage change in closing prices without using the logarithm.
Logarithmic: Uses the natural logarithm of daily returns. This method is particularly suitable for longer timeframes and scientific analyses, as logarithmic returns are additive.
These comprehensive features allow for precise customization of the Sigma Move Alert to individual needs and specific market conditions.
The user can set a threshold in standard deviations (Z-Score). When the absolute Z-Score exceeds this threshold, a significant movement is detected, indicating increased volatility. The Z-Score is visualized as a histogram, and an alert can be triggered when a significant movement occurs.
The number of trading days used to calculate historical volatility is adjustable, allowing the Sigma Move Alert to be tailored to various trading strategies and analysis periods.
Additionally, a dropdown option for the calculation method is available in the input menu, allowing the user to select between:
Normal: Calculates the percentage change in closing prices without using the logarithm.
Logarithmic: Uses the natural logarithm of daily returns. This method is particularly suitable for longer timeframes and scientific analyses, as logarithmic returns are additive.
These comprehensive features allow for precise customization of the Sigma Move Alert to individual needs and specific market conditions.
Release Notes
This indicator is designed to measure the statistical significance of daily price movements using the Z-Score. By comparing the current day's price change against a historical volatility baseline (Standard Deviation), it helps traders distinguish between normal market noise and statistical outliers that may indicate a breakout or extreme volatility.The main visual component is a dynamic histogram that automatically adjusts its color based on the severity of the move. Bars appear gray during normal market activity, turn orange when your custom threshold is crossed, and shift to red when the movement exceeds 2.0 standard deviations. This provides an immediate visual cue for high-volatility events directly on your chart.
To assist with risk management and planning, the indicator includes an on-screen statistics table that displays current volatility expectations. It calculates exactly what percentage price move constitutes a 1-sigma (68% probability), 2-sigma (95%), and 3-sigma (99%) deviation based on the current market conditions.
The script is fully customizable, allowing you to choose between Normal and Logarithmic calculation methods and adjust the lookback period (default is 252 days) to fit your specific strategy. A built-in alert condition is also included, allowing you to be notified instantly whenever the Z-Score breaches your defined threshold.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Life is long gamma
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Life is long gamma
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.