Loading…

Arnaud Legoux Moving Average

The Arnaud Legoux Moving Average (ALMA), published by Arnaud Legoux and Dimitrios Kouloumbis in 2009, tackles the same problem every fast moving average tries to solve - reduce the lag of a simple average without turning it into a noisy, whippy line - but with a different tool. Instead of double-weighting a weighted average the way a Hull MA does, ALMA applies a single Gaussian (bell curve) weighting to the window, then slides where that bell curve peaks. An offset near 1 pushes the peak weight onto the most recent bars, which is what removes most of the lag; the sigma input controls how sharp or flat the bell curve is, trading responsiveness against smoothness. The result behaves like a smoother, better-behaved cousin of a Hull-style average: it turns with price close to as quickly, but the smooth Gaussian taper - as opposed to the sharp double-weighting a Hull MA uses - rarely produces the small overshoot past the actual turning point that traders sometimes see on a Hull MA during a sharp reversal. It is still a lagging, backward-looking average, not a predictive tool, but it is a genuinely different weighting scheme from the moving averages already common in MQL4 collections, and one that is still oddly hard to find as a clean standalone implementation. Notes and limitations - Still a lagging average built from historical bars - it does not predict direction, it only reduces how far behind a genuine turn the line trails. - Each bar's value is recomputed independently from raw price inside its own window, so the line never repaints once a bar closes and a changed InpPeriod, InpOffset or InpSigma takes effect cleanly on every visible bar rather than leaving stale values behind. - The 0.85 / 6.0 defaults are Legoux and Kouloumbis's own suggested starting point, not a universal optimum - test both inputs on the instrument and timeframe actually being traded.

Indicator · MT5 · v1.0 · Free

About Arnaud Legoux Moving Average

Arnaud Legoux Moving Average is an indicator for MetaTrader 5. It has 4 settings, such as Period, Offset and Sigma. MQL source code included.

Files in the download: ArnaudLegouxMovingAverage.ex5, ArnaudLegouxMovingAverage.mq5, ArnaudLegouxMovingAverage.txt.

Settings

SettingDefaultWhat it does
Period9Window size, in bars
Offset0.850..1: how far the weight peak sits toward the newest bar
Sigma6.0Higher = sharper Gaussian taper, lower = flatter
Applied pricePRICE_CLOSEPrice series the average is applied to

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Moving Average · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria