Z-score oscillator measures how far a data point is from the mean, displaying whether it's above or below the average.
It helps you assess whether a stock's price is unusually high or low compared to its historical average.
If the z-score is positive, the stock may be overvalued, and if it's negative, it may be undervalued.
https://www.thetatrend.com/z-score-an-indicator-to-define-overbought-and-oversold-thinkscript/
https://www.google.com/search?q=zsc...cABAdoBBggBEAEYCdoBBggCEAEYCA&sclient=gws-wiz
It helps you assess whether a stock's price is unusually high or low compared to its historical average.
If the z-score is positive, the stock may be overvalued, and if it's negative, it may be undervalued.
https://www.thetatrend.com/z-score-an-indicator-to-define-overbought-and-oversold-thinkscript/
Ruby:
#Computes and plots the Zscore
#Provided courtesy of ThetaTrend.com
#Feel free to share the indicator, but please provide a link back to ThetaTrend.com
declare lower;
input price = close;
input length = 20;
input ZavgLength = 20;
#Initialize values
def oneSD = stdev(price,length);
def avgClose = simpleMovingAvg(price,length);
def ofoneSD = oneSD*price[1];
def Zscorevalue = ((price-avgClose)/oneSD);
def avgZv = average(Zscorevalue,20);
#Compute and plot Z-Score
plot Zscore = ((price-avgClose)/oneSD);
Zscore.setPaintingStrategy(paintingStrategy.HISTOGRAM);
Zscore.setLineWeight(2);
Zscore.assignValueColor(if Zscore > 0 then color.green else color.red);
plot avgZscore = average(Zscorevalue,ZavgLength);
avgZscore.setPaintingStrategy(paintingStrategy.LINE);
#This is an optional plot that will display the momentum of the Z-Score average
#plot momZAvg = (avgZv-avgZv[5]);
#Plot zero line and extreme bands
plot zero = 0;
plot two = 2;
plot negtwo = -2;
zero.setDefaultColor(color.black);
https://www.google.com/search?q=zsc...cABAdoBBggBEAEYCdoBBggCEAEYCA&sclient=gws-wiz
Last edited: