# MACD Explained: How the Indicator Is Built and Where It Fails

Source: https://cluenex.com/learn/technical-analysis/macd-explained/
Publisher: Cluenex (https://cluenex.com)
Updated: 2026-10-15

## Short answer

MACD (Moving Average Convergence Divergence) is the 26-period exponential moving average of price subtracted from the 12-period one, plotted with a 9-period signal line. It shows whether momentum is speeding up or fading, but it lags price and gives many false signals in sideways markets.

## Key takeaways

- MACD line = 12-period EMA minus 26-period EMA. The signal line is a 9-period EMA of the MACD line. The histogram is MACD minus the signal line.
- A MACD line above zero means the short-term average is above the long-term one. It describes recent trend direction, not a forecast.
- Crossovers of the signal line are common and often reverse quickly in range-bound markets, so MACD works best as context, not as a trigger.
- MACD is built from past prices, so it lags. It does not predict price, and no win rate for it should be assumed.
- Test any MACD rule on past data, with trading costs, before risking real money.

## What is MACD?

**MACD (Moving Average Convergence Divergence)** is a momentum indicator that measures the gap between two exponential moving averages (EMAs) of price. An EMA is an average that gives more weight to recent prices than to old ones.

Gerald Appel developed MACD in the late 1970s. The standard settings are 12, 26 and 9, and most charting platforms use them by default.

The idea is simple. When recent prices rise faster than older prices, the fast average pulls away from the slow one and MACD climbs. When the pace of gains fades, the two averages move back toward each other, which is the "convergence" in the name.

## How is MACD calculated?

MACD has three parts, each built from the one before it.

| Part | Formula | What it shows |
|---|---|---|
| MACD line | 12-period EMA minus 26-period EMA | Gap between short-term and longer-term trend |
| Signal line | 9-period EMA of the MACD line | A smoothed version of MACD |
| Histogram | MACD line minus signal line | Whether the gap is widening or narrowing |

The EMA weight for a period of N is 2 / (N + 1). For the 12-period EMA that is 2 / 13, or about 15.4% on the newest price. For the 26-period EMA it is 2 / 27, or about 7.4%.

**Worked example.** Suppose a stock's 12-day EMA is $105 and its 26-day EMA is $100. The MACD line is $105 minus $100 = +$5. If the signal line is $4.80, the histogram is $5.00 minus $4.80 = +$0.20.

A positive and growing histogram means the gap is widening faster than its own average. A positive but shrinking histogram means upward momentum is cooling, even though the stock may still be rising.

## How do you read MACD crossovers, the zero line and the histogram?

There are three common readings. Each describes what already happened to price, not what comes next.

- **Signal line crossover:** MACD crossing above the signal line means short-term momentum has turned up relative to its recent average. Crossing below means it has turned down. This is the earliest and noisiest reading.
- **Zero line crossover:** MACD crossing above zero means the 12-period EMA has moved above the 26-period EMA. It is slower and confirms a trend change that is already underway.
- **Histogram:** The bars change direction before the lines cross, because the histogram is the gap between them. Shrinking bars warn that a crossover may be near.

Because MACD is made only from past prices, it cannot move before price does. What looks like an early warning is the histogram turning while price is still drifting in the old direction.

## What is MACD divergence?

Divergence happens when price and MACD disagree. For example, a stock makes a new high but MACD makes a lower high than last time. That means the latest push up had less momentum than the previous one.

Divergence is a hint that a trend is tiring, not a sign that it has ended. Strong trends can show divergence for weeks while price keeps climbing.

## What is the best timeframe for MACD?

The 12, 26, 9 settings were designed for daily charts, where each period is one trading day. On shorter charts, such as 1 minute or 5 minute, the same settings react to small random moves, so signals flip often.

On weekly charts, the signals are slower and fewer, which suits people who check their account occasionally. There is no timeframe where MACD becomes reliable on its own.

## Where does MACD fail?

MACD is a trend-following tool, so it does best when prices trend and worst when they chop sideways.

- **Whipsaws:** In a flat, choppy market, MACD crosses the signal line repeatedly. Each cross looks like a signal and then reverses.
- **Lag:** Averages of past prices cannot lead price. By the zero line cross, a large part of a move may be over.
- **No size or time information:** MACD says nothing about how far or how long a move will go.
- **Not comparable across stocks:** MACD is measured in price units, so a reading of 2 means something very different for a $20 stock and a $500 stock.
- **Ignores the business:** MACD uses price only. It knows nothing about earnings, debt or valuation.

Published claims about MACD win rates vary widely and depend on the market, period and costs tested. Treat any single figure, including a high one, with caution unless the full test is shown.

## How does MACD compare with RSI and moving averages?

These tools answer different questions, and they all use the same underlying price data.

| Tool | Question it answers |
|---|---|
| Moving averages | Which way is the trend? See [moving averages explained](/learn/technical-analysis/moving-averages/) |
| MACD | Is the gap between fast and slow trend widening or narrowing? |
| RSI | How strong were recent gains compared with recent losses? See [RSI explained](/learn/technical-analysis/rsi-explained/) |

Because they share the same inputs, using several of them is not the same as getting independent confirmation. For a closer look at pairing the two, see [how to use MACD and RSI together](/learn/technical-analysis/macd-and-rsi-together/).

## How does Cluenex treat chart indicators?

Cluenex charts include common technical indicators such as moving averages and momentum oscillators. Cluenex treats chart patterns as context, not as buy or sell signals, because its own tests found no reliable directional edge in them. You can see how its signals are tested, including ones that failed and were retired, at [cluenex.com/signals](https://cluenex.com/signals/).

## What this means for you

If you have a job and a brokerage account, MACD is best used as a quick look at recent momentum, not as a trading system.

- Check that you can recompute it. If you cannot explain the 12, 26 and 9, do not rely on it.
- Look at the daily or weekly chart, not the 1-minute chart.
- Never act on a crossover alone. Ask what the company's earnings, debt and valuation say first. The [P/E ratio guide](/learn/technical-analysis/pe-ratio-valuation/) is one place to start.
- If you want to try a MACD rule, test it on past data of the same stock, include trading costs and taxes, and compare it with simply holding.
- Decide in advance how much you can lose on one position. See [position sizing](/learn/portfolio-management/position-sizing/).

## Questions people ask

### What do the numbers 12, 26 and 9 mean in MACD?

They are the periods of the three averages. 12 and 26 set the fast and slow EMAs whose difference is the MACD line, and 9 sets the EMA of that line used as the signal line. On a daily chart each period is one trading day.

### Is a MACD crossover a buy signal?

No. A crossover only says short-term momentum has changed direction relative to its recent average. It reverses often in sideways markets, so it works better as context than as a reason to trade.

### Can MACD predict a stock price?

No. MACD is calculated only from past prices, so it describes momentum that has already happened. It gives no target price and no time frame.

### What is the difference between MACD and the histogram?

The MACD line is the 12-period EMA minus the 26-period EMA. The histogram is the MACD line minus the signal line, so it shows whether the gap is widening or narrowing and tends to turn before the lines cross.

### Does MACD work on crypto or short timeframes?

The math works on any price series, but fast, volatile markets and very short charts produce many false crossovers. Daily or weekly charts are less noisy, and any rule should be tested on past data first.

## Sources

- [Technical Analysis: Moving Average Convergence Divergence (MACD)](https://www.investor.gov/introduction-investing/investing-basics/glossary/moving-average)
- [Moving average convergence divergence](https://en.wikipedia.org/wiki/MACD)
- [Exponential smoothing (weighting factor of an EMA)](https://en.wikipedia.org/wiki/Exponential_smoothing)

Cite as: Cluenex. "MACD Explained: How the Indicator Is Built and Where It Fails." Cluenex Learn, updated Oct 15, 2026. https://cluenex.com/learn/technical-analysis/macd-explained/
