Author: EarnForex
The 3rd Generation XMA is an innovative take on the traditional moving average indicator (MA) that helps traders minimize lag in their trading signals. If you're looking to improve your technical analysis, this advanced indicator might just be what you need!
Originally described by Dr. Manfred Dürschner in the article "Gleitende Durchschnitte 3.0," the XMA employs a unique approach using a λ value of 2, enhancing its capability to reduce lag effectively. The higher the λ, the more it resembles the classic moving average.
Input Parameters:
//+-----------------------------------+ //| Indicator input parameters | //+-----------------------------------+ input Smooth_Method XMA_Method=MODE_EMA; // Smoothing method input int XLength=50; // Smoothing depth input int XPhase=15; // Smoothing parameter input Applied_price_ IPC=PRICE_TYPICAL; // Price constant input int Shift=0; // Horizontal shift of the indicator in bars input int PriceShift=0; // Vertical shift of the indicator in points
This indicator allows you to choose from ten different averaging algorithms:
- SMA - Simple Moving Average;
- EMA - Exponential Moving Average;
- SMMA - Smoothed Moving Average;
- LWMA - Linear Weighted Moving Average;
- JJMA - Adaptive JMA Smoothing;
- JurX - Ultralinear Smoothing;
- ParMA - Parabolic Smoothing;
- T3 - Tillson's Multiple Exponential Smoothing;
- VIDYA - Smoothing using Tushar Chande's Algorithm;
- AMA - Smoothing using Perry Kaufman’s Algorithm.
Keep in mind that the Phase parameters vary greatly among different smoothing algorithms. For instance, in JMA, it’s an external Phase variable ranging from -100 to +100. Meanwhile, T3 uses a smoothing coefficient multiplied by 100 for clarity, and VIDYA refers to a CMO oscillator period. For the AMA, the slow EMA period is fixed, and the powering coefficient remains at 2.
The XMA indicator relies on the SmoothAlgorithms.mqh library classes, which you’ll need to copy into the terminal_data_directory\MQL5\Include. You can find a detailed explanation of using these classes in the article "Averaging Price Series for Intermediate Calculations Without Using Additional Buffers".

Fig.1 The 3rdGenXMA Indicator
Comments 0