VAMA Volume Adjusted Moving Average Function

This indicator is a live analysis adaptation of Richard Arms' Volume Adjusted Moving Average coded as a single function. VAMA utilizes a period length that is based on volume increments rather than time. Settings are provided for using as a pair of fast and slow moving averages.

SampleN - N volume bars used as sample to calculate average volume , 0 equals all bars.

VAMA Source - Price used for volume weighted calculations.

VAMA Length - Specified number of volume ratio buckets to be reached.

VAMA VI Fct - Size of volume ratio buckets.

VAMA Strict - Must meet desired volume requirements, even if number of bars has to exceed VAMA Length to do it.

Please see previous published example here for more details on VAMA's usage and inability to redraw the past on time based charts.

NOTICE: This is an example script and not meant to be used as an actual strategy. By using this script or any portion thereof, you acknowledge that you have read and understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script!
Release Notes: Revision 1

Removed function's local ‎reliance on global input nvb by changing it to use local _nvb instead, added cosmetic space, revised comment, no calculations are affected from previous version.

Previous lines:
    tvb = 0, tvb := _nvb == 0 ? ‎nz(tvb[1]) + 1 : nvb                           // total ‎volume bars in sample            
    tvs = nvb == 0 ? cum(‎volume) : sum(‎volume,nvb)                             // total ‎volume in sample

Revised lines:
    tvb = 0, tvb := _nvb == 0 ? ‎nz(tvb[1]) + 1 : _nvb                          // total ‎volume bars used in sample            
    tvs = _nvb == 0 ? cum(‎volume) : sum(‎volume, _nvb)                          // total ‎volume in sample
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?
Telegram: • Gunbot Tuners:

If you would like to buy me a refreshing beverage :)...

LTC (preferred): LTDaAe7nPzbpBhZVT9o5f9f8M3aZSPa46Y

BTC: 13LhkeXBYrRomVAqbXcoLXHuqMk6Mf7G6N


500 coins
allanster PineCoders
@PineCoders, thank you, very much appreciated!
Thanks for sharing and including the very thorough and helpful notes!
+2 Reply
allanster wroclai
@wroclai, thanks and good to see you!
+1 Reply
Wonderful indicator
+1 Reply
allanster raja74sekhar
@raja74sekhar, thanks for your comment, appreciated.
+1 Reply
As a freshman,I am so happpy and appreciative.
+1 Reply
allanster luckycat
@luckycat, thanks for your interest.
a very good trading tool. thanks for sharing.
1. Can we use it for 5min t/f?
2. Is it backtestable version available on TV?
Thanks again.
+1 Reply
allanster justnifty
@justnifty, thanks for your interest. The script will function on any timeframe. I believe the default settings that Richard Arms chose were for much higher timeframes. As a rule I never give trading advice so I would encourage you to do your own research. I have only done cursory backtests at this point and have not published a strategy version, but conversion from study script to strategy script is fairly simple to do.
+2 Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar About Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter