lazybeartv

Volume weighted MA

Aug 7th, 2016
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. //@version=2
  2. // @title Volume Weighted MA
  3. // @author LazyBear
  4. // List of my public indicators: http://bit.ly/1LQaPK8
  5. // List of my app-store indicators: http://blog.tradingview.com/?p=970
  6. //
  7. study("Volume Weighted MA [LazyBear]", overlay=true)
  8. src=input(close)
  9. lookback=input(10)
  10. ma(s,l) => sma(s,l)
  11.  
  12. //vma = ma( volume*src, lookback ) / ma(volume, lookback)
  13. nm_=src*volume, nm=sum(nm_,lookback)
  14. vma=nm/sum(volume,lookback)
  15. plot(vma, color=blue, linewidth=2, title="Volume weighted MA")
Add Comment
Please, Sign In to add comment