Thank you so much. This is where I ender up. //@version=4 study(title="Chaikin Money Flow", shorttitle="CMF", format=format.price, precision=2, resolution="") length = input(20, minval=1) ad = close==high and close==low or high==low ? 0 : ((2*close-low-high)/(high-low))*volume mf = sum(ad, length) /...