Introduction to MACD

Moving Average Convergence Divergence (MACD) is a trend-following momentum indicator that shows the relationship between two moving averages of a stock’s price. MACD helps investors understand whether the bullish or bearish movement in the price is strengthening or weakening. Created by Gerald Appel, it is designed to reveal changes in the strength, direction, momentum, and duration of a trend in a stock’s price.

The following are the topics of all the articles we will cover in our MasterClass on MACD:

Part 1: Introduction to MACD
Part 2: Centreline Crossover Strategy
Part 3: Signal Line Crossover Strategy
Part 4: MACD Histogram in Multiple Time-Frames
Part 5: MACD with Stochastic Indicator

In the Part – 1 of our MasterClass on MACD, we’ll be giving an in-depth introduction to what MACD is and how to use it. We’ll be discussing the following topics in-depth with descriptions on chart wherever necessary:

  • Trend-Following Momentum Oscillator
  • Exponential Moving Average
  • MACD Line
  • Convergence-Divergence Meaning
  • Signal Line
  • Histogram
  • Use Cases

Calculation

The MACD indicator as a whole consists of the MACD Line, the Signal Line and the MACD Histogram each with their own interpretations and uses. The following are the features and calculations of the MACD indicator:

  1. EMA – An exponential moving average (EMA) is a type of moving average (MA) that places a greater weight and significance on the most recent data points.  An exponentially weighted moving average reacts more significantly to recent price changes than a simple moving average (SMA), which applies an equal weight to all observations in the period.
intro to macd
12-EMA in Green and 26-EMA in Red
  1. MACD Line – MACD is calculated simply by subtracting the long-term EMA (26 periods) from the short-term EMA (12 periods). 

MACD=12-Period EMA − 26-Period EMA

intro to macd
Look how the MACD line moves above and below zero based on the difference of 9 and 12-EMA
  1. Signal Line –  A nine-day EMA of the MACD called the “signal line,” is then plotted on top of the MACD line, which can function as a trigger for buy and sell signals. 

Signal Line = 9-Period EMA of MACD Line

intro to macd
Signal Line as 9-EMA of MACD Line
  1. Histogram – MACD is often displayed with a histogram (see the chart below) which graphs the distance between the MACD and its signal line. If the MACD is above the signal line, the histogram will be above the MACD’s baseline. If the MACD is below its signal line, the histogram will be below the MACD’s baseline. Traders use the MACD’s histogram to identify when bullish or bearish momentum is high.
intro to macd
Histogram as the difference between MACD and Signal Line

Idea

The MACD turns two trend-following indicators (exponential moving averages) into a momentum oscillator by subtracting the longer moving average from the shorter one. By default, it is calculated by subtracting the 26-period Exponential Moving Average (EMA) from the 12-period EMA. As a result, the MACD offers the best of both worlds: trend following and momentum.

The MACD fluctuates above and below the zero line as the moving averages converge, cross and diverge. Traders can look for signal line crossovers, centerline crossovers and divergences to generate signals.

Parameters

There are 3 parameters associated with MACD. The look-back periods of shorter and longer EMA to define the MACD Line form the first two parameters of MACD. The third parameter is the look-back period of the EMA associated with the Signal Line. By default, a setting of (12, 26, 9) is used which means MACD Line is calculated as the difference of 12-EMA and 26-EMA whereas Signal Line is calculated by taking 9-EMA of the MACD Line.

Convergence-Divergence

As the name implies, the MACD is all about the convergence and divergence of the two moving averages. Convergence occurs when the moving averages move towards each other. Divergence occurs when the moving averages move away from each other. 

The shorter moving average (12-EMA) is faster and more reactive to recent price changes. The longer moving average (26-EMA) is slower and less reactive to price changes in the underlying security. This means that when the 12-EMA is greater than the 26-EMA, recent prices are rising and there’s a positive sentiment in the market. On the other hand, when the 12-EMA is smaller than 26-EMA it means that the recent prices are falling and there’s a negative sentiment in the market.

Positive MACD indicates that the 12-day EMA is above the 26-day EMA. Positive values increase as the 12-EMA diverges further from the 26-EMA. This means upside momentum is increasing. Negative MACD values indicate that the 12-day EMA is below the 26-day EMA. Negative values increase as the 12-EMA diverges further below the 26-EMA. This means downside momentum is increasing.

Use Cases

  1. Centreline Crossover: The MACD line oscillates above and below the zero line, which is also known as the centreline. These crossovers signal that the 12-day EMA has crossed the 26-day EMA. The direction, of course, depends on the direction of the moving average cross. 

    A bullish centreline crossover occurs when the MACD line moves above the zero line to turn positive i.e. 12-EMA crosses up 26-EMA. A bearish centreline crossover occurs when the MACD moves below the zero line to turn negative. 
intro to macd
MACD Line crossing up and down the centreline (zero) according to price momentum changes
  1. Signal Line Crossover: The signal line is a 9-day EMA of the MACD line which trails the MACD and indicates the momentum changes in convergence-divergence. A bullish crossover occurs when the MACD turns up and crosses above the signal line. A bearish crossover occurs when the MACD turns down and crosses below the signal line.
intro to macd
Bearish Signal Line Crossover
  1. MACD Divergence: A bullish divergence forms when a security records a lower low and the MACD forms a higher low. The lower low in the security affirms the current downtrend, but the higher low in the MACD shows less downside momentum. A bearish divergence forms when a security records a higher high and the MACD line forms a lower high. The higher high in the security is normal for an uptrend, but the lower high in the MACD shows less upside momentum.
intro to macd
Bearish Divergence
intro to macd
Bullish Divergence
  1. Histogram: The MACD Histogram is simply the difference between the MACD line and the MACD signal line.When a stock, future, or currency pair is moving strongly in a direction, the MACD histogram will increase in height. When the MACD histogram begins to shrink, the market is slowing down and might be warning of a possible reversal.
intro to macd
Negative Histogram during Downtrend; Positive Histogram during Uptrend

There are a lot more complicated use cases of MACD using the above shown methods. In the next article of our MACD MasterClass we’ll be talking about the Centreline Crossover strategy in a lot more detail.

Stay tuned!

Links

A few quick references below: