MACD (Moving average/Convergence divergence)

Moving average convergence-divergence (MACD) is one of the most popular momentum indicators used by traders. MACD takes 2 moving averages and turns them into a momentum oscillator by subtracting the longer period moving average from the shorter period moving average. What makes MACD unique among oscillators is that it can be used as a trend tracking tool or momentum indicator. The most common signals monitored by the traders are signal line crossings, center line crossings, and divergences. Since the MACD is an unbounded oscillator, it is not particularly useful for identifying overbought and oversold levels.

The MACD was invented by Gerald Appel in the 1970s, and in 1986, Thomas Aspray added a histogram to the MACD as a means of predicting MACD crossovers.

The MACD is considered a trend-following tool due to the use of moving averages. By subtracting the longer period moving average, the MACD converts from a lagging indicator to a momentum oscillator. MACD fluctuates above and below zero without any upper or lower boundaries.

Crossovers

The basic rule of MACD trading is to sell when the MACD falls below the signal line. Likewise, a buy signal occurs when the Moving average convergence/divergence rises above the signal line. It is also popular to buy/sell when the MACD goes above/below zero.

Divergence

An indication that the end of the current trend may be near occurs when the MACD diverges from the symbol. A bullish divergence occurs when the Moving average convergence/divergence indicator reaches new highs while prices fail to reach them. A bearish divergence occurs when the MACD makes new lows while prices fail to reach new lows. Both of these divergences are most significant when they occur at relatively overbought/oversold levels.

Calculation

The MACD is calculated by subtracting the 26-period exponential moving average value from the 12-period exponential moving average. A 9-period dotted simple moving average of the MACD (signal line) is then plotted on top of the MACD.

MACD = EMA (CLOSE, 12) – EMA (CLOSE, 26)

SIGNAL = SMA (MACD, 9)

Where:

  • EMA — Exponential moving average;

  • SMA — Simple moving average;

  • SIGNAL — the signal line of the indicator.

Main parameters

  • Sources prices for MA – determines the type of price at which the moving average is calculated, available values: Close, Open, High, Low, Median, Typical, Weighted;

  • Period of FastEMA –number of periods for calculating the exponential moving average, 12 by default (classic value for this indicator);

  • Period of SlowEMA – number of periods for calculating the exponential moving average, 26 by default (classic value for this indicator);

  • Type of MA for signal – type of the moving average for a signal line: Simple, Exponential, Modified, Linear weighted;

  • Period of signal – defines the period of a signal line, 9 by default.

This indicator looks as follows on the chart:

Last updated