MACD Divergence Indicator for Metatrader 4

In this article, we are going to present another technical indicator designed for the Metatrader 4 platform, which shows divergences between the price and the MACD indicator both in the price chart and in the indicator window. That is, it signals the times when the price is moving in one direction and the MACD is moving in the opposite direction. Trading with divergences between price and indicator is a popular way to use the MACD and other oscillator-type indicators, such as RSI, CCI, and Stochastic Oscillator.

Basically, divergences occur when the price moves in one direction and the indicator moves in another, that is, they start to diverge. In the case of the MACD, which is an indicator of price momentum, a divergence may indicate that market momentum is starting to change and therefore the price may start to move in the opposite direction at any time. We can distinguish two basic types of divergences between price and MACD:

  • Bullish divergence: They form when the price is falling (forming lower lows) while the MACD is rising (forming higher lows). It indicates that the market bearish momentum is decreasing and that the price could start to rise.
  • Bearish divergence: They form when the price is rising (forming higher highs while the MACD is falling (forming lower highs). It indicates that the bullish momentum of the market is decreasing and that the price could start to rise.
One of the main problems with divergences is that they can often indicate a possible price reversal, but in reality no real market reversal occurs. In other words, they can produce false signals. Therefore, divergences should be used in conjunction with other tools that confirm their signals, in order to increase their reliability.

What is MACD?

The Moving Average Convergence/Divergence (MACD) indicator is one of the most popular technical indicators and was developed by Gerald Appel in 1979.

It is designed to reveal changes in the strength, direction, momentum, and duration of a trend in the price of an asset. Although it is an oscillator, it is generally not used to identify overbought or oversold conditions as the RSI.

It appears on the graph as two lines that oscillate without limits, along with a histogram that crosses up and down the zero level. The crossing of the two lines of the indicator generates trading signals similar to those produced by the trading systems based on the intersections of two moving averages. Now we are going to properly describe the MACD divergence indicator.

MACD Divergence Indicator

The MACD Histogram indicator is a modified version of the classic Metatrader 4 MACD indicator, which displays the MACD line, signal line, and MACD convergence-divergence histogram in a separate terminal window, and it also allows to find divergences between the indicator and the price chart of three main types:

  • Classic divergences
  • Hidden divergences
  • Extended divergences

In other words, it is a more complete version of the MACD which in addition to the indicator classic trading signals it also adds those generated by the divergences between the indicator and the price. We can see what this indicator and its signals look like when added to a price chart in the following image:

MACD Divergences Indicator
AUD/USD 4-hour price chart with the MACD Divergence Indicator

In the chart above, we can see the MACD Histogram indicator applied to the AUD/USD 4-hour chart. In fact, the indicator shows the standard MACD indicator and highlights the divergences found in it.

These divergences are highlighted with red or green lines on the price chart and the indicator, depending on the type of divergence: bullish or bearish. In addition, the indicator shows arrows of different colors that suggest the direction of possible open trades according to the divergences found between the price and the MACD.

This indicator can be flexibly configured for its use in any trading strategy developed by the trader. In the image below, the MACD Histogram indicator was applied on the USD/CHF price chart, configured to show only the MACD line, signal line, and divergences.

MACD Indicator Settings
MACD Divergence Indicator Configuration Window

Indicator settings

The following are the configurable parameters of the MACD Histogram indicator:

  • Fast EMA Period – period of the fast exponential moving average.
  • Slow EMA Period – period of the slow exponential moving average.
  • Signal SMA Period – period of the simple moving average of the signal line.
  • MACD line – enables the display of the MACD line.
  • Signal line – enables the display of the MACD line.
  • MACD Histogram divergence indicator – allows the search of price divergences with the MACD histogram.
  • MACD Line divergence indicator – allows the search of price divergences with the MACD line.
  • Search classical – allows the search of classical divergences.
  • Search hidden – allows the search of hidden divergences.
  • Search extended – allows the search of extended divergences.
  • Show trend lines – allows the display of trend lines in divergences.
  • Show divergence indicator – enables the display of the divergence indicator.
  • Show alerts – activates an alert when a divergence is found in the current bars.

Download indicator

You can download the MACD Histogram indicator for MT4 to find divergences between price and MACD at the following link:

How to install the MACD Histogram indicator on MT4?

  • Download the file MASi_MACDHist.mq4_-1 (this file is included among the files that can be downloaded through the previous link)
  • Copy and paste the MASi_MACDHist.mq4_-1 file into the MQL4/Indicators directory of the platform installation.
  • Start or restart your Metatrader 4 platform
  • Select the price chart and time frame where you want to test the MACD Histogram indicator.
  • Look for “Custom Indicators” on your MT4 platform.
  • Click where it says “MACD Histogram“.
  • Modify the indicator settings or click “OK
  • The MACD Histogram indicator is now displayed below your price chart.

Considerations regarding trading with price divergences and MACD

The MACD Histogram indicator greatly facilitates the search for divergences in the price charts of any instrument. However, the trader must clearly understand that the identification of divergences, and even more so their correct interpretation, is a rather complicated analytical process and divergences often generate false signals.

Any divergences indicator should be used precisely as an informative and auxiliary tool. The trader must independently verify and adjust each signal of the indicator and, in no case, open positions in the market with real money based solely on the signals provided by this indicator.


Leave a Comment