Skip to content

Intermediate · Lesson 6 of 12

MACD Indicator Explained: Lines, Histogram and Signals

Learn how MACD is built from 12- and 26-period EMAs with a 9-period signal line, how to read the histogram, crossovers and divergence, and where it falls short.

3 min read Updated By FXPIPS Editorial Desk

Key takeaways

  • The MACD line is the 12-period EMA minus the 26-period EMA.
  • The signal line is a 9-period EMA of the MACD line, and the histogram is the MACD line minus the signal line.
  • Crossovers, zero-line crosses and divergence describe changes in momentum that have already happened.
  • Because MACD is built from moving averages, it lags price and produces false signals in ranges.
Contents

MACD stands for Moving Average Convergence Divergence. Developed by Gerald Appel in the late 1970s, it is one of the most widely used indicators because it blends two ideas into one display: the direction of the trend and the strength of momentum. To understand MACD, it helps to be comfortable with moving averages, especially the EMA.

The three components

MACD is usually shown in a separate panel below the price chart. With the standard 12, 26, 9 settings it contains:

  1. MACD line = 12-period EMA − 26-period EMA
  2. Signal line = 9-period EMA of the MACD line
  3. Histogram = MACD line − signal line

The EMAs are normally calculated on closing prices. Because the MACD line is the difference between two prices, on a pair like EUR/USD it is expressed in price units. A MACD value of 0.0025 means the 12-period EMA sits 25 pips above the 26-period EMA.

Convergence and divergence

When the two EMAs move apart, the MACD line moves away from zero (divergence of the averages). When they move together, it moves toward zero (convergence). That is where the name comes from.

Worked example

Assume, for illustration, the following values on a daily EUR/USD chart.

Day 1

  • 12-period EMA: 1.0875
  • 26-period EMA: 1.0850
  • MACD line: 1.0875 − 1.0850 = 0.0025
  • Signal line: 0.0018
  • Histogram: 0.0025 − 0.0018 = 0.0007

Day 2

  • 12-period EMA: 1.0880
  • 26-period EMA: 1.0858
  • MACD line: 1.0880 − 1.0858 = 0.0022
  • Signal multiplier: 2 ÷ (9 + 1) = 0.2
  • New signal line: (0.0022 − 0.0018) × 0.2 + 0.0018 = 0.00008 + 0.0018 = 0.00188
  • Histogram: 0.0022 − 0.00188 = 0.00032

Both EMAs rose on day 2, but the gap between them narrowed and the histogram shrank from 0.0007 to 0.00032. Upward momentum is still positive but slowing. That is information about the recent past, not a forecast that price will fall.

How traders read MACD

Signal-line crossovers

  • MACD line crosses above the signal line: momentum is turning up.
  • MACD line crosses below the signal line: momentum is turning down.

These are the most common MACD signals and also the most prone to whipsaws in sideways markets.

Zero-line crossovers

When the MACD line crosses above zero, the 12-period EMA has moved above the 26-period EMA. A cross below zero means the opposite. Zero-line crosses are slower than signal-line crosses but filter out some noise.

The histogram

The histogram shows the distance between the MACD line and the signal line. Bars growing taller show strengthening momentum in that direction; bars shrinking toward zero show it is fading. A shrinking histogram often comes before a signal-line crossover, which is why some traders watch it closely.

Divergence

As with the RSI indicator, divergence occurs when price and MACD disagree:

  • Price makes a higher high while MACD makes a lower high: bearish divergence.
  • Price makes a lower low while MACD makes a higher low: bullish divergence.

Divergence can last a long time and does not tell you when, or whether, price will turn.

MACD vs RSI

FeatureMACDRSI
ScaleUnbounded, centered on zeroFixed, 0 to 100
Built fromExponential moving averagesAverage gains and losses
Overbought/oversold levelsNo fixed levelsTraditionally 70 and 30
StrengthTrend and momentum togetherMomentum extremes

Because MACD has no upper or lower limit, its values cannot be compared directly across pairs with very different prices, such as EUR/USD and USD/JPY.

Common mistakes

  • Trading every crossover. In ranges, crossovers come thick and fast and many fail.
  • Forgetting the lag. MACD uses two moving averages and an average of their difference, so signals often arrive after much of a move is over.
  • Comparing MACD values across pairs with different price scales.
  • Using MACD without price context. A bullish crossover directly beneath major resistance carries more risk.
  • Skipping practice. Test how MACD behaves on different pairs and timeframes in the Trading Simulator before using real money.

Summary

MACD subtracts the 26-period EMA from the 12-period EMA, adds a 9-period EMA of that result as a signal line, and plots the difference as a histogram. Traders watch signal-line crossovers, zero-line crosses, histogram changes and divergence. MACD helps describe trend and momentum, but it lags, struggles in ranges and never guarantees what price will do next. Next, Bollinger Bands add a volatility dimension to moving averages.

Glossary terms in this lesson

Check your understanding

A quick 3-question quiz. Your answers are not stored or sent anywhere.

Question 1

Question 1 of 3

How is the MACD line calculated with the standard settings?

Question 2

Question 2 of 3

The MACD line is 0.0025 and the signal line is 0.0018. What is the histogram value?

Question 3

Question 3 of 3

What does a MACD line crossing above zero tell you?

Answered 0 of 3

Practice worksheet

Practice worksheet

4 exercises to try on paper. Print it, save it as a PDF from the print dialog, or download a plain-text copy.

  1. If the 12-period EMA is 1.2745 and the 26-period EMA is 1.2760, calculate the MACD line. Is it above or below zero?
  2. Calculate the multiplier for the 9-period signal line using 2 ÷ (N + 1).
  3. The MACD line is 0.0030 and the signal line is 0.0034. Calculate the histogram and say whether it is positive or negative.
  4. On a daily chart, mark three MACD signal-line crossovers and note whether each was followed by a sustained move or a whipsaw.

Finished this lesson?

Track your progress through the intermediate course — saved privately in this browser.

Educational content only, not financial advice. Examples use illustrative prices, not live quotes. Trading leveraged products carries a high risk of loss. See our risk disclaimer.

Try it yourself