VMA - Variable Moving Average


This variation of an EMA automatically smoothes any fluctuations in the market, and its sensitivity grows as more weight is placed on more recent data.

The VMA attempts to get rid of the disadvantages of other moving averages by automatically regulating the smoothing constant. This is why the VMA can be implemented for most of the market conditions, and is in a few cases actually better than other averages.

Caution The VMA is not to be confused with the Volume Moving Average (VolMA)!


VMA(int period, int volatilityPeriod)
VMA(IDataSeries inSeries, int period, int volatilityPeriod)
VMA(int period, int volatilityPeriod)[int barsAgo]
VMA(IDataSeries inSeries, int period, int volatilityPeriod)[int barsAgo]

Return value


When using this method with an index (e.g. VMA(9,9)[int barsAgo] ), the value of the indicator will be issued for the referenced bar.


inSeries Input data series for the indicator

period Number of bars included in the calculations

volatility period Number of bars included in the calculation for the signal line



//Output the VMA value
Print("The current VMA value is " + VMA(9, 9)[0]);

Last updated