Learn › Technical analysis

MACD Explained: Reading the MACD Line, Signal Line and Histogram

What MACD's name means, the 12 26 9 EMA formula, crossovers, the zero line and the histogram, with a worked example and the places MACD misleads most.

Intermediate 8 min read 16 October 2026

What you will learn
  • MACD is the gap between EMA 12 and EMA 26. Lines moving apart is divergence, lines moving together is convergence
  • The zero line shows whether the fast EMA is above or below the slow one, and signal-line crosses show momentum changing
  • The histogram usually shrinks before the lines cross, but a shrinking histogram does not mean price will reverse
  • MACD always lags price and crosses back and forth constantly in sideways markets
  • MT5 draws MACD differently from TradingView, so know which one you are reading

MACD (Moving Average Convergence Divergence) measures the gap between two exponential moving averages: a fast 12-bar EMA and a slow 26-bar EMA. Gerald Appel developed it in the late 1970s to show both trend direction and momentum in one tool, and today it ships with every charting platform. This article covers what the name means, the formula, a worked example, and the situations where MACD misleads.

If EMAs are new to you, read Moving averages: types and popular settings first. This article will be much easier to follow.

What “convergence divergence” means

The long name describes exactly how the indicator works.

  • Divergence (moving apart): EMA 12 and EMA 26 spread further apart. This happens when price moves strongly in one direction. The fast line keeps up with price, the slow line falls behind, and MACD moves away from zero.
  • Convergence (moving together): the two lines close in on each other. This happens when price slows down or turns. MACD moves back toward zero.
  • When the two lines cross, the gap is zero, and so is MACD.

The convergence and divergence in MACD’s name refer to the gap between the two EMAs. They are not the price-versus-indicator divergence traders talk about. Those are two different ideas.

Close EMA 12 EMA 26 Gap between EMAs = MACD value Spreading apart: MACD rises Converging: MACD falls EMA 12 crosses below EMA 26 = MACD crosses below zero 0 MACD line (EMA 12 − EMA 26)
An illustrative 120-bar synthetic series, not a real market. EMA 12, EMA 26 and MACD are calculated with the standard formulas. The blue shading in the top panel is the gap between the two EMAs, which is the MACD value in the bottom panel. The dashed vertical line marks the bar where EMA 12 crosses below EMA 26.

The four parts of MACD

PartFormulaWhat it tells you
MACD lineEMA 12 − EMA 26 of the closeThe gap between the two EMAs. Positive means the fast line is above the slow one
Signal line9-period EMA of the MACD lineMACD’s own average, used to see whether MACD is speeding up or slowing down
HistogramMACD − SignalThe gap between MACD and its signal line, drawn as bars
Zero lineMACD = 0Where EMA 12 exactly equals EMA 26

An EMA’s multiplier is 2 ÷ (period + 1). So EMA 12 gives the newest bar a weight of 2 ÷ 13 ≈ 15.4%, EMA 26 gives 2 ÷ 27 ≈ 7.4%, and the 9-period signal line gives 2 ÷ 10 = 20%.

MACD is measured in price units. Gold’s MACD is in dollars, while EURUSD’s is a small decimal, so you can’t compare MACD values across markets, or across periods when price levels were very different. MACD also has no ceiling or floor like RSI, so there are no fixed overbought or oversold levels. If you need a version you can compare across markets, PPO divides the gap by EMA 26 and expresses it as a percentage.

Worked example, step by step

Say the previous bar ends with EMA 12 = 100.000 and EMA 26 = 98.000, so MACD = 2.000. The signal line is 1.500 and the histogram is 0.500.

Bar 1 closes at 106

  1. EMA 12 = 100.000 + 0.1538 × (106 − 100.000) = 100.000 + 0.923 = 100.923
  2. EMA 26 = 98.000 + 0.0741 × (106 − 98.000) = 98.000 + 0.593 = 98.593
  3. MACD = 100.923 − 98.593 = 2.330 (up from 2.000, the lines moved apart)
  4. Signal = 1.500 + 0.2 × (2.330 − 1.500) = 1.666
  5. Histogram = 2.330 − 1.666 = 0.664 (up from 0.500)

Bar 2 closes at 103. Price dips, but stays above both EMAs.

  1. EMA 12 = 100.923 + 0.1538 × (103 − 100.923) = 100.923 + 0.320 = 101.243
  2. EMA 26 = 98.593 + 0.0741 × (103 − 98.593) = 98.593 + 0.326 = 98.919
  3. MACD = 101.243 − 98.919 = 2.324 (slightly lower)
  4. Signal = 1.666 + 0.2 × (2.324 − 1.666) = 1.798
  5. Histogram = 2.324 − 1.798 = 0.526 (shrinking)

Bar 2 is the interesting one. Both EMAs are still rising, but EMA 26 rises more (+0.326 against +0.320) because the close is much further away from it. The lines start to converge, MACD flattens, and the histogram shrinks for the first time, all while price sits above both averages. That is what fading momentum looks like. It is not a sign that price will reverse.

Three ways to read MACD

1. MACD crossing the signal line

MACD crossing above its signal line means MACD is rising faster than its own average. Crossing below means it is slowing. This is MACD’s fastest signal, which also makes it the one that misleads most often. The moment MACD crosses the signal line is exactly when the histogram crosses zero, because the histogram is the gap between those two lines.

2. MACD crossing the zero line

MACD crossing above zero is EMA 12 crossing above EMA 26, the same moving-average crossover many traders already watch. It is slower than a signal-line cross but gives fewer false signals. Many traders use the side of the zero line as a direction filter, for example only paying attention to upward signal-line crosses while MACD is above zero, and downward crosses while it is below.

3. The histogram shows momentum

A growing histogram means MACD is pulling further away from its signal line. A shrinking histogram means MACD is still heading the same way, just more slowly. Because the signal line is an average of MACD, the histogram usually shrinks visibly before the lines cross. Some traders treat that as a cue to be careful, such as not adding to a position or watching an open trade more closely. It is not a cue to open a trade the other way.

Sideways stretch 5 crossovers in 42 bars ①②③ MACD Signal Histogram ① Histogram peaks: momentum fades while price still rises ② MACD crosses below signal, yet price rises 18 more bars ③ Price tops; MACD crosses zero only 14 bars later 0
The same synthetic series as the first chart, not a real market, with standard MACD 12 26 9 (EMA signal line). Circles mark MACD crossing its signal line, the yellow area is the sideways stretch, and the dashed vertical lines mark points ① ② ③ described under the chart.

When MACD misleads

It always lags. MACD is built from EMAs, which are built from past prices. In the chart above, MACD crosses below zero 14 bars after price has already topped. By the time the signal arrives, price has already come down a good way.

Signal-line crosses in the middle of a trend. Slowing momentum does not mean the trend is over. In the same chart, MACD crosses below its signal line while price goes on rising for another 18 bars.

Sideways markets are its biggest weakness. When price swings inside a range, EMA 12 and EMA 26 almost sit on top of each other, MACD hugs zero, and it crosses the signal line again and again. In the chart that happens 5 times in 42 bars. When both EMAs are flat and tangled, treat crossovers as close to meaningless. ADX is another way to check whether the market is trending.

The current bar isn’t finished. MACD on an open bar keeps changing with the latest price. A cross that appears mid-bar can disappear by the close. Only count signals on closed bars.

MACD describes what price has already done. It doesn’t tell you where price will go next. It helps you organise how you read a chart. It doesn’t predict the future.

Price-versus-MACD divergence

Another popular use is spotting when price makes a new high but MACD or the histogram makes a lower high, meaning momentum is weakening even though price is still rising. In a strong trend this kind of divergence can appear several times in a row without price turning. Both regular and hidden divergence are covered in Regular and hidden divergence.

Can you change 12 26 9?

Yes, but every change is a trade-off. Here is the same price series as the charts, with MACD calculated three ways and counted from bar 10 to bar 119.

SettingsSignal-line crosses in totalIn the 42-bar sideways stretchZero cross down after the price topZero crosses in the sideways stretch
6 13 5 (fast)964 bars later3
12 26 9 (standard)6514 bars later1
24 52 18 (slow)2127 bars later0

Fast settings notice a change in trend sooner but give more false crosses in a range. Slow settings almost never whipsaw, but by the time they confirm a change, price has moved a long way. This is a single synthetic series, so real numbers depend on the market, but the direction of the trade-off is always the same. The advantage of 12 26 9 is that most traders watch the same values, and tuning the numbers to fit past charts rarely carries over to the future.

MACD in MT5 looks different from TradingView

MT5’s built-in MACD draws the MACD line as bars and the signal as a line. It has no MACD − Signal histogram. So the bars you see in MT5 are the MACD line itself, and bars crossing zero means EMA 12 crossing EMA 26. MT5’s formula also builds the signal line with an SMA, not an EMA, so its signal values differ from TradingView, which uses an EMA by default and shows all three parts: the MACD line, the signal line and the histogram.

If you read an article or watch a video about the histogram and then open MT5, be careful. The bars in MT5 are not the same histogram.

One more detail: an EMA needs a fair amount of price history before it settles. MACD values near the start of a chart may not match another platform, which rarely matters when the chart has enough history.

Using MACD with risk management

MACD doesn’t tell you where to place a Stop loss or how big a position to take. Those have to come from price and from your account.

  1. Check the market condition first. Two EMAs clearly apart and pointing the same way means a trend. If they are flat and tangled, set crossover signals aside.
  2. Place the Stop loss from price structure or volatility, for example below the latest swing low, or at a distance based on ATR. Not at the point where MACD crosses back, because by then price may have gone further than you can afford.
  3. Size the position from the Stop loss distance so the loss per trade stays fixed. The method is in Position size from your Stop loss.
  4. Don’t count the same thing twice. MACD, RSI and Stochastic all measure momentum from the same prices. Three of them agreeing is not three times the evidence. Read more in Combining indicators without redundancy.

Common mistakes

  • Mixing up the divergence in the name with price divergence. The first is two EMAs moving apart. The second is price and MACD moving in different directions
  • Trading signal-line crosses in a sideways market and getting caught again and again
  • Trading against the trend because the histogram shrinks. Shrinking means momentum is slowing. Price can keep going for a long time
  • Comparing MACD values across markets, or treating a high value as overbought. MACD has no such levels
  • Misreading the histogram in MT5. The bars in MT5 are the MACD line, not MACD − Signal
  • Tweaking the settings to fit past charts. It looks great in hindsight and rarely works on new data
  • Counting a signal mid-bar. Until the bar closes, the lines can still change
Try it with your own numbers

Frequently asked questions

What are the best MACD settings?

There is no best setting. 12 26 9 is the standard most traders use. Smaller numbers give faster signals but more false ones, larger numbers give smoother signals but later. Every change is a trade-off, not an upgrade.

Does MACD have overbought and oversold levels like RSI?

No. MACD has no ceiling or floor, and its value is in price units, so gold and EURUSD have MACD values of completely different sizes. A reading that was high in the past does not mean price has risen too far now.

Why don't MACD values in MT5 and TradingView match?

MT5 builds the signal line with an SMA, while TradingView uses an EMA by default, and each broker's closing prices differ slightly. The values won't match exactly, but the overall shape is similar.

This is general education, not investment advice. Trading is risky and you may lose all of your capital.

Tools Chat on LINE