-
Handy custom command for transforming any data series into more normalized type: Z-score
More information: https://www.investopedia.com/terms/z/zscore.asp
Example:
local close = ClosePrices() local zscore = CC_Z_Score(close, 30, 10) -- Plot(0, 'zscore', zscore, LineOptions(Red, Spiked, Solid, 1, 0, LeftAxis, '', true, false)) PlotHorizontalLine(0, 'z-zero', Gray, 0, Dashed, LeftAxis) -- if CrossOver(zscore, 0) then PlotVerticalLine(0, '', Purple, Time(), Dashed) elseif CrossUnder(zscore, 0) then PlotVerticalLine(0, '', Cyan, Time(), Dashed) end