Understanding MACD

Yutong Xie
Analytics Vidhya
Published in
3 min readDec 27, 2020

Because there is no way to predict the future accurately, there shouldn’t be a single technical indicator that tries to predict the future without making one of the two possible presumptions— momentum or contrarian. On the other hand, if we do not view all these technical indicators as possible “predictors” but view them as “measures” of current condition, we will actually be better informed because we don’t have to follow the implied assumption in those indicators.

How is MACD calculated?

This is an example of MACD:

It says “MACD(12,26,9,exponential,no)”. Let’s first understand these parameters and then understand the blue and yellow lines.

12: the number of periods used to calculate the fast moving average (SimpleMA).

26: the number of periods used to calculate the slow moving average (SimpleMA).

9: the number of periods used to calculate the moving average of the difference between the slow moving average and the fast moving average.

exponential: calculate exponential moving average of the difference between the slow moving average and the fast moving average.

no: let’s ignore it.

The blue line is the difference between the slow moving average and the fast moving average. The yellow line is the 9-period exponential moving average of such difference. MACD just means how the blue line oscillate around the yellow line. The bars marks the difference between the blue line and the yellow line.

As you can probably tell. When the blue line is above the yellow line, it means the difference between a fast and a slow moving average is big relative to the exponential moving average and vice versa.

MACD measures strength of trend

So by construction is measuring how different is the fast MA from the slow MA and how this difference compares with it’s exponential MA. This is measuring how strong the current trend is. The blue line is high and different from the yellow line when the stock price rises a lot. Again, this is contemporary. I am not saying that the stock price *will* increase a lot.

When the blue line is crossing below the yellow line, the stock price does not necessarily reverse. When the growth slows down, the blue line will cross below the yellow line.

Verdict

By construction, MACD measures the strength of trend, not the change of trend. A trend can get weak and then get strong again. It is not necessary that a trend will get weak and then reverse.

I actually don’t believe that any of the technical indicators, however fancy they are, can provide consistent long-term prediction power of future stock price or stock returns because of the presumed model. However, the measures themselves will provide valid information about the current market condition. If you can feed the information into your own model, it is possible to make inference about future stock prices.

--

--