[pshaiCmd] Z-Score

0 271 Views No Comments 6 months ago
  • Handy custom command for transforming any data series into more normalized type: Z-score

    More information: https://www.investopedia.com/terms/z/zscore.asp


    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)
    • This topic was modified 5 months, 3 weeks ago by pshai.
    HaasScript Code
    Sign in or Register to view
Login or Register to Comment

Unlock your crypto trading potential

Create a free account and enjoy everything we have to offer.

Join for Free