OPEN-SOURCE SCRIPT

Price Z-Score

124
The goal of this Pine Script is to visually represent how much price deviates from its rolling average via the Z-score statistic in TradingView's indicators section. This script first uses a user-definable "lookback" period (the default is 20 bars) to calculate a moving average and standard deviation. Then it displays the price as an amount of standard deviation greater than or less than the moving average. A moving Z-score is plotted along with three reference lines (+2, 0, -2) to indicate areas of unusual extremes statistically; also, it colors the chart green for when price is in the lower half of the Z-score range (oversold) and red for when price is in the upper half of the Z-score range (overbought). These can be used by traders to recognize price has moved out of normal ranges and is due to revert to its mean.

คำจำกัดสิทธิ์ความรับผิดชอบ

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.