MACD Indicator – Moving Averages Convergence and Divergence

The Moving Average Convergence and Divergence (MACD) indicator was developed by Gerald Appel in the late seventies. Traders consider MACD to be the oldest and most important indicator. It was invented in the seventies, but momentum traders still consider MACD to be one of the most reliable indicators.

As the name also suggests, MACD is about the convergence (convergence) and divergence (divergence) of two moving averages. A convergence occurs when two moving averages move toward each other, and a divergence occurs when the moving averages move away from each other.

A typical MACD is calculated using a 12 day EMA and a 26 day EMA. Please note that both EMAs are based on the closing price. To estimate Convergence & Divergence – CD, we subtract the 26 EMA from the 12 day EMA. Its a straight line graph is often referred to as the ‘MACD line’. First understand the calculation and then understand the use of MACD.

Date Close 12 days EMA 26 days EMA MACD Line
1-Jan-14 6302
2-Jan-14 6221
3-Jan-14 6211
6-Jan-14 6191
7-Jan-14 6162
8-Jan-14 6175
9-Jan-14 6168
10-Jan-14 6171
13-Jan-14 6273
14-Jan-14 6242
15-Jan-14 6321
16-Jan-14 6319
17-Jan-14 6262 6230
20-Jan-14 6304 6226
21-Jan-14 6314 6233
22-Jan-14 6339 6242
23-Jan-14 6346 6254
24-Jan-14 6267 6269
27-Jan-14 6136 6277
28-Jan-14 6126 6274
29-Jan-14 6120 6271
30-Jan-14 6074 6258
31-Jan-14 6090 6244
3-Feb-14 6002 6225
4-Feb-14 6001 6198
5-Feb-14 6022 6176
6-Feb-14 6036 6153 6198 -45
7-Feb-14 6063 6130 6188 -58
10-Feb-14 6053 6107 6182 -75
11-Feb-14 6063 6083 6176 -94
12-Feb-14 6084 6066 6171 -106
13-Feb-14 6001 6061 6168 -107

We start by looking at the table above from the left:

We have dates starting from January 1, 2014.
Following the dates we have the closing price (close price) of Nifty.
We discard the first 12 data points (the closing price of Nifty) to calculate the 12 day EMA.
We leave out the first 26 data points to calculate the 26 day EMA.
Once we find the 12 day and 26 day EMA parallel to each other (from 6 February 2014) we calculate the MACD.
MACD price = [12 day EMA – 26 day EMA] For example on 6 February 2014, the 12 day EMA was 6153, and the 26 day EMA was 6198, so MACD would be 6153-6198 = – 45.

When we calculate MACD based on 12 and 26 day EMA and plot it as a line graph, we get MACD line, which rotates above and below the central line.

Date Close 12 day EMA 26 day EMA MACD line
1-Jan-14 6302
2-Jan-14 6221
3-Jan-14 6211
6-Jan-14 6191
7-Jan-14 6162
8-Jan-14 6175
9-Jan-14 6168
10-Jan-14 6171
13-Jan-14 6273
14-Jan-14 6242
15-Jan-14 6321
16-Jan-14 6319
17-Jan-14 6262 6230
20-Jan-14 6304 6226
21-Jan-14 6314 6233
22-Jan-14 6339 6242
23-Jan-14 6346 6254
24-Jan-14 6267 6269
27-Jan-14 6136 6277
28-Jan-14 6126 6274
29-Jan-14 6120 6271
30-Jan-14 6074 6258
31-Jan-14 6090 6244
3-Feb-14 6002 6225
4-Feb-14 6001 6198
5-Feb-14 6022 6176
6-Feb-14 6036 6153 6198 -45
7-Feb-14 6063 6130 6188 -58
10-Feb-14 6053 6107 6182 -75
11-Feb-14 6063 6083 6176 -94
12-Feb-14 6084 6066 6171 -106
13-Feb-14 6001 6061 6168 -107
14-Feb-14 6048 6051 6161 -111
17-Feb-14 6073 6045 6157 -112
18-Feb-14 6127 6045 6153 -108
19-Feb-14 6153 6048 6147 -100
20-Feb-14 6091 6060 6144 -84
21-Feb-14 6155 6068 6135 -67
24-Feb-14 6186 6079 6129 -50
25-Feb-14 6200 6092 6126 -34
26-Feb-14 6239 6103 6122 -19
28-Feb-14 6277 6118 6119 -1
3-Mar-14 6221 6136 6117 20
4-Mar-14 6298 6148 6112 36
5-Mar-14 6329 6172 6113 59
6-Mar-14 6401 6196 6121 75
7-Mar-14 6527 6223 6131 92
10-Mar-14 6537 6256 6147 110
11-Mar-14 6512 6288 6165 124
12-Mar-14 6517 6324 6181 143
13-Mar-14 6493 6354 6201 153
14-Mar-14 6504 6380 6220 160

: 400;”>MACD

After looking at the price, try to answer a few questions:

What does a negative MACD represent?
What does a positive MACD represent?
What does high or low MACD mean? What does a -90 MACD vs a – 30 MACD tell?

The signal attached to MACD indicates the direction of movement of the stock. For example if the 12 day EMA is 6380, and the 26 day EMA is 6220 then the MACD value is +160. Now what do you think under which circumstances the 12 day EMA will be higher than the 26 day EMA? Well, we looked at this in the Moving Averages chapter. The short term average will generally be higher than the long term average especially when the stock price is trending up. Also remember that the short term average will always be more responsive to the current market price (CMP) than the long term average. Hence a positive signal tells us that the stock has positive momentum, and the stock is moving upwards. The higher the momentum, the higher the bounce. For example, +160 shows a positive trend and is stronger than +120.

However, while dealing with the magnitude, always remember that the price of the stock affects the magnitude. For example, something like Bank Nifty that has a higher value of its own, the higher will be the magnitude of MACD.

When MACD is negative, it means that the 12 day EMA is lower than the 26 day EMA. Hence momentum is also negative. Higher the magnitude of MACD, more will be the strength in negative momentum.

The difference between two moving averages is called the MACD spread. When the momentum decreases, the spread decreases and when the momentum increases, the spread increases. Traders usually chart the MACD, often called the MACD line, to visualize convergence and divergence.

Below is the MACD line chart of Nifty for the data points from January 1, 2014 to August 18, 2014.

As you can see the MACD line is around a zero line. It is also called ‘center line’. The basic explanation of MACD is that:

When the MACD line crosses the center line from negative to positive, it means there is a divergence between the two averages. This is a sign of rapidly increasing momentum; So it should be seen as a buying opportunity. In the chart above we can see this happening around February 27th.
When the MACD line crosses the center line from the positive zone to the negative zone, it means that there is a convergence between the two averages. This is a sign of a growing recession; Therefore, it should be seen as a sales opportunity. As you can see in the chart above, MACD went almost negative twice (on 8th May and 24th July) but then it just stopped at the center line and reversed its direction.

Traders generally argue that if you wait for the MACD line to cross the center line, the move is almost over and there is no opportunity to trade. To deal with this problem a change is made to the MACD line. This change is brought about by adding one more thing to MACD – adding the 9 day signal line. The 9 day signal line is an exponential moving average (EMA) of the MACD line. So we have two lines:

A MACD line.

The 9-day EMA line of the MACD line, also called the signal line.

With these two lines, the trader can create a simple 2 line crossover strategy as explained in the Moving Averages chapter, and the trader will no longer have to wait for the center line to cross over.

When the MACD line crosses the 9 day EMA, the sentiment is bullish and the MACD line crosses the 9 day EMA. When this happens, the trader should buy.
When the MACD line crosses below the 9 day EMA, the MACD line is below the 9 day EMA. When this happens, the trader must sell.

Below is the chart of the MACD indicator on Asian Paints Ltd. You can see that the MACD price is at the bottom of the chart.

Here the indicator uses simple MACD parameters:

12 day EMA of closing prices
26 day EMA of closing prices
MACD line (12 days EMA – 26 day EMA) is shown by a black line.
The 9 days EMA of the MACD line is shown by the red line.

The vertical lines on the chart indicate the crossover points on the chart where either a buy or sell signal has occurred.

For example, the first vertical line on the left shows a crossover where the MACD line is below the signal line (9 days EMA) and suggests a short trade.

The second vertical line on the left indicates a crossover where the MACD line is above the signal line, so there is a buying opportunity here. Similarly, it goes on.

Please note, at the core of the MACD system are moving averages. Therefore the MACD indicator has the same properties as a moving average system. They work quite well when there is a strong trend and these indicators are not very useful when the markets are moving sideways or without a trend. You can notice it between the first two lines on the left.

You can manipulate the MACD rule. You can enter any time frame as per your requirement in place of 12 days and 26 days EMA. But personally, I prefer to use MACD in its original form, as created by Gerald Appel.

Highlights of this chapter

  • MACD is a trend-following system.
  • MACD has 12 days, 26 days EMA.
  • MACD line is 12d EMA – 26d EMA.
  • The signal line is the 9 day SMA of the MACD line.
  • A crossover strategy can be created between the MACD line and the signal line.
  • It is good to know about the indicator, but it should not be seen as the only source for decision-making.