Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=5
- indicator("Awesome Cumulative Volume Oscillator", "ACVO", overlay=false)
- series = input(50, "length")
- bs_isfirst = ta.barssince(barstate.isfirst)+1
- weight_volume = (ta.change(close)/close[1]) * volume
- cum_volume = ta.cum(weight_volume) / bs_isfirst
- [middle, upper, lower] = ta.bb(cum_volume, series, 1)
- sma_isfirst = ta.cum(cum_volume)/(bs_isfirst)
- isfirst_ma = series>bs_isfirst? sma_isfirst :middle
- cum_m_ma = cum_volume-isfirst_ma
- plot(cum_m_ma, title="Cumulative Volume Deviation")
- plot(0, color=color.red, title="Zero-Line", display=display.pane)
- plot(upper-isfirst_ma, "Upp-Deviation", color=color.black, display=display.pane)
- plot(lower-isfirst_ma, "Down-Deviation", color=color.black, display=display.pane)
Add Comment
Please, Sign In to add comment