xmd79

Awesome Cumulative Volume Oscillator

May 5th, 2023
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. //@version=5
  2. indicator("Awesome Cumulative Volume Oscillator", "ACVO", overlay=false)
  3. series = input(50, "length")
  4. bs_isfirst = ta.barssince(barstate.isfirst)+1
  5. weight_volume = (ta.change(close)/close[1]) * volume
  6. cum_volume = ta.cum(weight_volume) / bs_isfirst
  7. [middle, upper, lower] = ta.bb(cum_volume, series, 1)
  8. sma_isfirst = ta.cum(cum_volume)/(bs_isfirst)
  9. isfirst_ma = series>bs_isfirst? sma_isfirst :middle
  10. cum_m_ma = cum_volume-isfirst_ma
  11. plot(cum_m_ma, title="Cumulative Volume Deviation")
  12. plot(0, color=color.red, title="Zero-Line", display=display.pane)
  13. plot(upper-isfirst_ma, "Upp-Deviation", color=color.black, display=display.pane)
  14. plot(lower-isfirst_ma, "Down-Deviation", color=color.black, display=display.pane)
Add Comment
Please, Sign In to add comment