Nicolas

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
ALMA - Arnaud Legoux Moving Average

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: 369
Nicolas
Nicolas Legend
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

PeP2016
3 years ago
#

Hi, simple and nice idea. One question though: I read 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. but can't see this double "run". Can you please explain this point? thanks.

Bruno Carnazzi
6 years ago
#

Moyenne mobile intéressante, dommage qu'elle soit si gourmande en puissance de calcul. Les valeurs supérieures à 200 (ou pire 500) ont tendance à peser sur PRT. C'est un peu mieux en v11 mais ça reste un point noir (freeze de quelques secondes pour recalcul de la MM)

Nicolas
6 years ago
#

ok.

SB-FO
6 years ago
#

Nicolas, how does one convert this into an indicator?

Nicolas
6 years ago
#

This is already an indicator. Download the itf file, import it into ProRealTime an apply it on the price chart.

ACPRT
6 years ago
#

Bonjour . j'ai un problème lorsque la variable Windows prend la valeur très grande, par exemple à partir de 300, j'ai seulement un petit bout de la courbe. Est-ce que quelqu'un aurait une petite idée ? Je vous remercie par avance de votre réponse.

Nicolas
6 years ago
#

Augmenter la quantité d'unités affichées à l'écran

supertiti
10 years ago
#

Sorry ! erreur de débutant ! le bug venait de " appliqué à " qui s'adressait à ALMA en place de customclose ...

supertiti
10 years ago
#

Bonjour Nicolas

J'ai mis la moyenne ALMA sur des prix et j'ai ajouté une autre moyenne simple par exemple p= 11 , quand je bouge les paramètres de ALMA l'autre moyenne bouge aussi !

Est ce normal ? et si oui pourquoi ?

merci, bonne journée

 

Nicolas
10 years ago
#

Bonjour titi, je pense que tu dois faire erreur, ça n'est possible :)

ProRealCode ProRealCode
Loading...