MACD (Moving Average Convergence Divergence)

Share this content

In our articles on SMA (Simple Moving Average) and EMA (Exponential Moving Average), we have seen how useful comparing several Moving Averages can be to detect trends. The Moving Average Convergence Divergence is an indicator built from the difference between two Exponential Moving Averages of different periods.

How to calculate the MACD indicator?

The first thing to calculate are the two EMAs. Generally, traders prefer to use a 12-period and and 26-period EMA. You may refer to our article on Exponential Moving Averages if you don’t know how to calculate an EMA. The first element of the indicator is then the difference between the shorter and the longer EMA. A Signal line is added, which consists in the 9-period EMA of the MACD.

How to interpret the Moving Average Convergence Divergence?

The MACD gives us three informations. First, the it indicates the direction of the trend. A rising MACD line represents a positive trend – since it means that the short EMA is above the long EMA. A downward line represents a negative trend.

Sedond, this indicator also gives the strength of the trend. The greater the distance between the two lines, the stronger the trend. Indeed, the greater the distance, the fastest the price is moving away from the two EMAs. And remeber that the short EMA follows the price quicker than the long one. This translates into larger candles. The larger the candle, the stronger the trend.

Third, the MACD indicator also gives buy or sell signals. It is generally considered that the MACD line crossing above the Signal line gives a buy signal. When the MACD line crosses below the Signal line, the indicator gives a sell signal.

Example of buy and sell signals given by MACD

On the price chart:

  • The blue line is the 12-period EMA.
  • The yellow line is the 26-period EMA

On the MACD chart:

  • The pink line is the MACD (the difference between the 12-period EMA and the 26-period EMA).
  • The green line is the Signal (the 9-period EMA of the MACD).
  • The bar chart represents the MACD. It is green and facing upward when the MACD is positive, and red and facing downward when it falls below 0.

We can see that the market turns bullish when the MACD gives a buy signal. The MACD line crosses above the Signal line. The trend reversal is signalled way before the the 12-period EMA crosses above the 26-period EMA. The market becomes bearish when the MACD falls below the Signal line. Once again, the sell signal is given way before the short EMA crosses below the long EMA.