ALMA - Arnaud Legoux Moving Average

Category: Indicators By: Nicolas Created: June 6, 2016, 8:18 AM
June 6, 2016, 8:18 AM
Indicators
10 Comments

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

 

Download
Filename: ALMA.itf
Downloads: 358
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...