Commodity Channel Index & Average True Range
study(title="Commodity Channel Index", shorttitle="CCI") length = input(20, minval=1) src = input(close, title="Source") ma = sma(src, length) cci = (src - ma) / (0.015 * dev(src, length)) plot(cci, color=olive) band1 = hline(100, color=gray, linestyle=dashed) band0 = hline(-100, color=gray, linestyle=dashed) fill(band1, band0, color=olive)