SHARE
TWEET

Volume weighted MA

lazybeartv Aug 7th, 2016 39 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top