OBV indicator with moving averages on it.
// // @author Albert // // Created on LazyBear's OBV indicator basis // study(title="On Balance Volume Analysis [Albert]", shorttitle="OBV_A") src = close length = input(20, minval=1, title="Length") threshold=input(0, title="threshold for OBV") lengthema=input(13, title="EMA length") obv(src) => cum(change(src) > 0 ? volume : change(src) < 0 ? -volume : 0*volume) o=obv(src) c=cci(src, length) plot(o, color=c>=threshold?green:red, title="OBV", linewidth=2) plot(ema(o,lengthema), color=orange, linewidth=2)