The ALMA moving average uses curve of the Normal (Gauss) distribution which can be placed by Offset parameter from 0 to 1. This parameter allows regulating the smoothness and high sensitivity of the Moving Average. Sigma is another parameter that is responsible for the shape of the curve coefficients. This moving average reduce lag of the informations but still being smooth to reduce noises.
This method of price average calculation could be used for any others technical indicators that used moving average for their own calculation (RSI, MACD, Stochastic, etc.).
From the Author: (Arnaud Legoux & Dimitris Kouzis-Loukas)
It removes small price fluctuations and enhances the trend by applying a moving average twice, one from left to right and one from right to left. At the end of this process the phase shift (price lag) commonly associated with moving averages is significantly reduced. Zero-phase digital filtering reduces noise in the signal. Conventional filtering reduces noise in the signal, but add delay.
The ALMA can give some excellent results if you take the time to tweak the parameters (don’t need to explain this part, it will be easy for you to find the right setting in less than hour)..
// parameters
// Window = 9
// Sigma = 6
// Offset = 0.85
Price = Close
m = (Offset * (Window - 1))
s = Window/Sigma
WtdSum = 0
CumWt = 0
for k = 0 to Window - 1 do
Wtd = Exp(-((k-m)*(k-m))/(2*s*s))
WtdSum = WtdSum + Wtd * Price[Window - 1 - k]
CumWt = CumWt + Wtd
next
ALAverage = WtdSum / CumWt
RETURN ALAverage