Redjinator
4/15/2020 - 5:31 PM

MA Deviation Rate

_maPeriod   = input(21, title="Moving average period")
_sma        = sma(close, _maPeriod)
_rate       = close / _sma * 100 - 100
_stdCenter  = sma(_rate, _maPeriod * 2)
devUp       = _stdCenter>_stdCenter[1]