OPEN-SOURCE SCRIPT

On Balance Volume Crossover

100
//version=5
indicator(title="On Balance Volume with EMA", shorttitle="OBV EMA", overlay=false)

// OBV Calculation
obv = ta.cum(math.sign(ta.change(close)) * volume)
plot(obv, color=color.blue, title="On Balance Volume")

// EMA Input
emaLength = input.int(14, title="EMA Length")
emaOBV = ta.ema(obv, emaLength)
plot(emaOBV, color=color.yellow, title="EMA of OBV")

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.