# MACD

> Structure, signal line, and interpretation.

Module: Technical Analysis — Finotaur Academy (free lesson)
Source: https://www.finotaur.com/academy/technical-analysis/macd

## You'll be able to

Compute the MACD line, signal line and histogram from 12-, 26- and 9-period EMAs, and read crossovers, the zero line and divergence as trend context with known lag.

## In plain words

MACD — Moving Average Convergence Divergence — measures the gap between a fast and a slow exponential moving average of price. When the fast average pulls away above the slow one, upward momentum is building; when the gap narrows, momentum is fading. A second average of that gap (the signal line) and the difference between the two (the histogram) make changes in momentum easier to see, but everything in MACD is built from moving averages, so it always lags price.

```takeaways
- **MACD line** = EMA(12) − EMA(26) of the close. **Signal line** = EMA(9) of the MACD line. **Histogram** = MACD − signal.
- MACD is in **price units**, so raw values cannot be compared between instruments at different prices — use the percentage version (PPO) for that.
- **Above zero** means the 12-EMA is above the 26-EMA; the zero-line cross is the same as a 12/26 EMA crossover.
- The histogram shrinking shows momentum **slowing** before the lines cross — context, not a signal.
```

## Quick demo

**Updating MACD for three bars (hypothetical numbers).** Yesterday: EMA(12) = **104.80**, EMA(26) = **103.50**, signal line = **1.20**. The multipliers are 2 ÷ 13 = **0.1538** for the 12-EMA, 2 ÷ 27 = **0.0741** for the 26-EMA and 2 ÷ 10 = **0.20** for the 9-period signal.

**Bar 1 — close 108.70.**
- EMA(12) = 104.80 + 0.1538 × (108.70 − 104.80) = **105.400**
- EMA(26) = 103.50 + 0.0741 × (108.70 − 103.50) = **103.885**
- MACD = 105.400 − 103.885 = **1.515**
- Signal = 1.20 + 0.20 × (1.515 − 1.20) = **1.263**
- Histogram = 1.515 − 1.263 = **+0.252**

**Bar 2 — close 104.00.** EMA(12) = 105.185, EMA(26) = 103.894, MACD = **1.291**, signal = **1.269**, histogram = **+0.022** — momentum has almost stalled.

**Bar 3 — close 103.00.** EMA(12) = 104.849, EMA(26) = 103.827, MACD = **1.021**, signal = **1.219**, histogram = **−0.198**. The MACD line has crossed below the signal line.

Note that MACD is still **above zero** at 1.021: the 12-EMA remains above the 26-EMA, so the medium-term trend is still up even though short-term momentum has turned.

```chart
{
  "type": "bar",
  "title": "MACD histogram for the demo bars (arithmetic on hypothetical closes)",
  "data": [["Bar 1", 0.252], ["Bar 2", 0.022], ["Bar 3", -0.198]],
  "highlight": ["Bar 3"],
  "notes": { "Bar 3": "Histogram below zero: MACD crossed under its signal line." },
  "caption": "Exact arithmetic from the demo's starting values and closes. Not real market data."
}
```

## Full explanation

### The three components

Gerald Appel developed MACD in the late 1970s; the histogram was added later and is now standard on every platform.

1. **MACD line** = EMA(12) − EMA(26). Positive when the faster average is above the slower one.
2. **Signal line** = 9-period EMA of the MACD line — a smoothed version of it.
3. **Histogram** = MACD line − signal line. It shows whether the MACD line is pulling away from or converging toward its own average.

The defaults 12, 26 and 9 originated on daily charts. They are now used on every timeframe out of convention. Other settings exist, but changing them to make past signals look better is curve-fitting.

```stats
12 | Fast EMA | Multiplier 2 ÷ 13 ≈ 0.1538
26 | Slow EMA | Multiplier 2 ÷ 27 ≈ 0.0741
9 | Signal EMA | Multiplier 2 ÷ 10 = 0.20
MACD − signal | Histogram | Positive when MACD is above its signal
```

### Reading MACD

- **Zero line.** MACD above zero = the 12-EMA is above the 26-EMA = an upward bias in the medium term. A cross through zero *is* a 12/26 EMA crossover.
- **Signal-line crossovers.** MACD crossing above the signal line shows short-term momentum turning up; crossing below shows it turning down. A bullish crossover below zero happens during a downtrend; above zero, during an uptrend. The latter is in the direction of the larger trend.
- **Histogram.** Because it is the difference between MACD and its average, the histogram turns before the lines cross. A shrinking histogram — like bar 2 in the demo — says momentum is fading, not that the trend has ended.

### Divergence

As with RSI, divergence compares price swings to indicator swings. Price makes a higher high while the MACD line (or histogram) makes a lower high: the second push had less momentum. Divergence can repeat several times in a strong trend before price turns, or never lead to a turn. Treat it as a reason to tighten risk, and look for a break in price structure for confirmation.

### Why MACD values are not comparable across markets

MACD is a difference between two prices, so it is in the instrument's price units. A MACD of 2.0 on a $40 stock is a big gap; on a $4,000 index it is tiny. The **Percentage Price Oscillator (PPO)** fixes this: PPO = (EMA(12) − EMA(26)) ÷ EMA(26) × 100. In the demo's bar 1, PPO = 1.515 ÷ 103.885 × 100 ≈ **1.46%**. Use PPO when comparing momentum between instruments or across long periods in which price changed a lot.

```warning
MACD is built from three moving averages of price, so every signal comes after the move it describes. In sideways markets, signal-line crossovers occur constantly and many reverse within a few bars. Check whether the market is trending before trading crossovers, and expect some lag on every signal.
```

### Practical ways to use it

1. **As a trend filter**: favour longs when MACD is above zero, shorts when below.
2. **To time pullback entries within a trend**: in an uptrend (MACD above zero), a pullback that brings the MACD line down toward its signal or the histogram near zero, followed by a renewed upturn, shows momentum resuming.
3. **For risk management**: a shrinking histogram or bearish divergence during a long trade is a reason to tighten the stop or take partial profit.

In every case, entries and stops come from price — swing highs and lows, support and resistance — not from the indicator value.

```tip
Look at the histogram's slope, not just its sign. Three bars of a shrinking positive histogram tell you momentum is fading while the trend is still up — often a better moment to manage an existing long than to open a new short.
```

### MACD across timeframes

The same 12/26/9 settings mean very different things on different charts. On a daily chart, the 26-period EMA covers about five weeks of trading; on a five-minute chart, a little over two hours. A bullish daily MACD and a bearish five-minute MACD are not in conflict — they describe different horizons.

A common approach is to read MACD on the timeframe above the one you trade for bias, and on your trading timeframe for timing. For example, a swing trader might only take long setups on the daily chart while the weekly MACD is above zero, and use the daily histogram turning up from a pullback to time entries. A day trader might do the same with an hourly chart for bias and a five-minute chart for timing.

Keep the pairing fixed. If you look at enough timeframes, one of them will always agree with the trade you already want to take.

### Common mistakes

- **Trading every signal-line cross** regardless of trend.
- **Comparing raw MACD values** between different instruments.
- **Forgetting the lag**: by the time the zero line crosses, much of the move may be over.
- **Treating divergence as a reversal signal** without a price trigger.
- **Optimising the 12/26/9 settings** to fit historical charts.

```checklist
title: MACD reading routine
- Confirm settings: EMA 12, EMA 26, signal 9, on closes.
- Note whether MACD is above or below zero (the trend bias).
- Read the histogram slope: expanding or shrinking momentum?
- Take signal-line crosses only in the direction of the zero-line bias.
- Check for divergence against the last two price swings.
- Set entries and stops from price structure, not from MACD values.
```

```quiz
[
  {
    "q": "EMA(12) is 52.40 and EMA(26) is 51.10. The signal line is 1.00. What is the histogram?",
    "options": ["1.30", "0.30", "−0.30", "2.30"],
    "answer": 1,
    "why": "MACD = 52.40 − 51.10 = 1.30. Histogram = 1.30 − 1.00 = 0.30."
  },
  {
    "q": "The previous signal line is 0.50 and today's MACD is 1.00. What is today's signal line?",
    "options": ["0.60", "0.75", "1.00", "0.55"],
    "answer": 0,
    "why": "Signal = 0.50 + 0.20 × (1.00 − 0.50) = 0.50 + 0.10 = 0.60."
  },
  {
    "q": "MACD crosses from below zero to above zero. What does that mean?",
    "options": ["RSI crossed 50", "The 12-EMA has crossed above the 26-EMA", "The histogram turned negative", "Volume increased"],
    "answer": 1,
    "why": "MACD = EMA(12) − EMA(26), so it is positive exactly when the 12-EMA is above the 26-EMA."
  },
  {
    "q": "Why use PPO instead of MACD to compare momentum in a $20 stock and a $2,000 stock?",
    "options": ["PPO is faster", "PPO expresses the EMA gap as a percentage, so it is comparable across price levels", "PPO uses volume", "MACD only works on indices"],
    "answer": 1,
    "why": "MACD is in price units; PPO divides by the slow EMA, giving a percentage."
  }
]
```
