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 |
| 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 |
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.
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.
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 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.