Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Third Generation XMA - MetaTrader 5 Script | Forex Indicator Download - MT4/MT5 Resources

author EAcpu | 6 reads | 0 comments |

3rd Generation XMA - indicator for MetaTrader 5

The third generation of XMA is the third generation of moving averages. This is an advanced version of the standard Moving Average indicator (МА), which follows a fairly simple procedure of reducing the time lag based on the increasing period of the moving average.

Dr. Manfred Dürschner first described this method in his article "Gleitende Durchschnitte 3.0" (in German). This implementation uses λ = 2, which reduces lag more efficiently. Higher λ increases the similarity to the classical moving average.

Input parameters:

//+------------------------------------------------+
//|Indicator input parameters |
//+------------------------------------------------+
Enter Smooth_Method XMA_Method= mode_EMA ; // Smoothing method
Input integer X length = 50 ; // smoothing depth
Input integer X phase = 15 ; // Smoothing parameter
Input Application_Price_IPC= Price_TYPICAL ; // Price constant
Enter integer shift = 0 ; // horizontal movement of the indicator in bars
Input integer price movement = 0 ; // vertical movement of the indicator in points

This indicator allows you to choose the averaging algorithm from ten possible options:

It should be noted that the Phase parameters of different smoothing algorithms have completely different meanings. For JMA, it is an external Phase variable that varies from -100 to +100. For T3, it is the smoothing coefficient multiplied by 100 for better visualization. For VIDYA, it is a CMO oscillator period. And for AMA, it is a slow EMA period. These parameters do not affect smoothing in other algorithms. For AMA, the fast EMA period is a fixed value, equal to 2 by default. The power supply factor of AMA is also fixed at 2.

The indicator uses the SmoothAlgorithms.mqh library class (to be copied to terminal_data_directory\MQL5\Include). The use of the class "Average price series for intermediate calculations without using additional buffers" is described in detail in the article.

3rd Generation XMA - indicator for MetaTrader 5

Figure 1 The third generation XMA indicator


Attachment download

📎 3rdgenxma.mq5 (8.21 KB)

📎 smoothalgorithms.mqh (133.8 KB)

Source: MQL5 #1032

Verification code Refresh