Overlay shows difference between OBV and OBV's moving average as green and red dos above and below cendles.
Designed to fast divergence detection.
Designed to fast divergence detection.
study(title="OBV Shadow", shorttitle="OBVShad", overlay=true) window_len = input(28, defval=28, minval=1, title='Window Lenght') obv_len = input(14, defval=14, minval=1, title='OBV smooth Lenght') price_spread = stdev(high-low, window_len) obv = cum(change(close) > 0 ? volume : change(close) < 0 ? -volume : 0*volume) smooth = sma(obv, obv_len) obv_spread = stdev(obv - smooth, window_len) shadow = (obv - smooth) / obv_spread * price_spread out = shadow > 0 ? high + shadow : low + shadow color = shadow > 0 ? green : red plot(out, style=cross, color=color) // out = close > close[1] ? shadow : -shadow // plotarrow(out, colorup=green, colordown=red, transp=50, title='Volume Shadow')