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

MACD with Price Extreme Definition - MetaTrader 5 Script | Forex Indicator Download - MT4/MT5 Resource

author EAcpu | 4 reads | 0 comments |

The MACD with the definition of price extremums - indicator for MetaTrader 5

The MACD with the definition of price extremums - indicator for MetaTrader 5

Real author:

Unlike the usual MACD types, the _MACD_Xtr indicator differs in its adaptive overbought/oversold areas (red and green lines) and when entering the MACD in these areas, the bar color is also displayed in the corresponding color in the histogram.

Usually in order to adapt the indicator to the regulator, the indicator itself is used. For example, if the MACD range increases, the corresponding overbought/oversold zone levels will also increase. The problem with this approach is phase delay. ie. First the indicator will show that overbought or oversold area, then with a smoothed delay it will move those areas to a new level. Therefore, extreme values ​​will appear at the very beginning of the movement, and the significance of this adaptation is only for subsequent extreme values. If these are V-/\ formations, why not WM formations? And losing profits from the first extreme is undesirable.

What's the solution? Due to the lack of a time machine, it is reasonable to use sources of volatility with shorter periods than the adaptive indicator itself. In this case, you can "preempt" the movement of the indicator, changing the levels of PC/PP before they start moving. But this is a complexity caused by the control signal satisfying two conflicting conditions. On the one hand, it cannot be smoothed to avoid phase delays when volatility increases, and on the other hand, the level reached by the same volatility needs to be maintained and filtered out from the noise.

To solve this problem, use front and damping separation smoothing filtering, the principle is as follows here . In this case, you only need damping filtering and don't need to control the filtering of the signal front end at all. (It would be better to increase the volatility of the cycle itself.)))

Indicator input parameters:

 //+------------------------------------------------------------------------+
//|Indicator input parameters |
//+------------------------------------------------------------------------+
Enter integer fast MA= 12 ; // fast EMA period
Enter integer slow MA= 26 ; // slow EMA period
Input AlgMode source=ATR; // source
Input unit source period = 22 ; // The period of the source
Input unit previous sentence = 1 ; // edge smoothing period; mb <1
Input unit return period = Chapter 444 ; // Damping smoothing period; mb <1
Enter double x volatility = 0.5 ; // volatility
Input unit sense = 0 ; // Sense point limit. or in ticks (volume)
Input ENUM_APPLIED_VOLUME volume type = volume_scale ; // volume
Input integer shift = 0 ; //Horizontal movement of the indicator (in bars)

The indicator was first implemented in MQL4 and published in the code base of mql4.com on February 4, 2010.

The MACD with the definition of price extremums - indicator for MetaTrader 5

Figure 1 MACD_Xtr indicator.


Attachment download

📎 macd_xtr.mq5 (13.56 KB)

Source: MQL5 #1219

Verification code Refresh