The X2MA NRTR indicator is a powerful tool for traders using MetaTrader 5. It enhances moving average values by applying the NRTR algorithm, also known as Nick Rypock Trailing Reverse. This sophisticated approach helps in identifying potential trend reversals and supports your trading decisions.
Notably, the GODZILLA EA, which clinched third place in the Automated Trading Championship 2006, is built on a breakout trading system that leverages the insights provided by this indicator.
When using the X2MA NRTR, you have a selection of ten different smoothing algorithms to choose from:
- SMA - Simple Moving Average;
- EMA - Exponential Moving Average;
- SMMA - Smoothed Moving Average;
- LWMA - Linear Weighted Moving Average;
- JJMA - JMA Adaptive Average;
- JurX - Ultralinear Smoothing;
- ParMA - Parabolic Smoothing;
- T3 - Tillson's Multiple Exponential Smoothing;
- VIDYA - Smoothing with Tushar Chande's Algorithm;
- AMA - Smoothing with Perry Kaufman's Algorithm.
It’s important to note that the Phase1 and Phase2 parameters vary in meaning depending on the smoothing algorithm you select. For example, in JJMA, it’s an external Phase variable that can range from -100 to +100. In contrast, for T3, it refers to a smoothing ratio multiplied by 100 for better visualization, while for VIDYA, it’s the CMO oscillator period, and for AMA, it’s the slow EMA period. In other algorithms, these parameters won’t affect smoothing. For AMA, the fast EMA period is fixed at a default value of 2, and the power ratio is also set to 2.
To utilize the X2MA NRTR indicator effectively, you’ll need to include the SmoothAlgorithms.mqh library classes (make sure to copy it to the terminal_data_folder\MQL5\Include). A thorough explanation of these classes can be found in the article "Averaging Price Series for Intermediate Calculations Without Using Additional Buffers".

Indicator Input Parameters:
//+-----------------------------------+//| Indicator input parameters |//+-----------------------------------+input Smooth_Method MA_Method1=MODE_SMA; // First smoothing averaging method inputint Length1=12; // First smoothing depth inputint Phase1=15; // First smoothing parameter//---- for JJMA Phase1 is changed at the range -100 ... +100 impacting transition process quality;//---- for VIDIA Phase1 is the CMO period, for AMA it is a period of the slow moving averageinput Smooth_Method MA_Method2=MODE_JJMA; // Second smoothing averaging method inputint Length2= 5; // Second smoothing depth inputint Phase2=15; // Second smoothing parameter//---- for JJMA Phase2 is changed at the range -100 ... +100 impacting transition process quality;//---- for VIDIA Phase2 is the CMO period, for AMA it is a period of the slow moving averageinput Applied_price_ IPC=PRICE_CLOSE; // Price constant/* The indicator calculation is performed at that price (1-CLOSE, 2-OPEN, 3-HIGH, 4-LOW, 5-MEDIAN, 6-TYPICAL, 7-WEIGHTED, 8-SIMPLE, 9-QUARTER, 10-TRENDFOLLOW, 11-0.5 * TRENDFOLLOW.) */inputuint Step=30; // Flat oscillations size//---- this parameter determines the size of oscillations perceived as flat(discretization digital pitch in points)inputuint Max_DEV=55; // Terminal deviation of price from X2MA that does not change the value of the averageinputint Shift=0; // Horizontal shift of the indicator in barsinputint PriceShift=0 // Vertical shift of the indicator in points

Comments 0