Revision 2
Added basic error protection, but some instruments and/or combinations of settings may still error due to the computational expense of using multiple for loops. Changed limit for maximum loops to VAMA Length * 5. Situations where a large number of bars is required to meet volume requirements can result in calculations exceeding 20000ms. These situations may arise when VAMA Length and/or Volume Incr settings are too high, and/or the instrument's liquidity is too low. The typical use range of settings has been tested successfully without error against AAPL, BTCUSD, DOGEUSDT, and EURUSD. These were chosen to cover wide range of price and volume possibilities.