On this page
MACD — Momentum, in its own panel below the chart.
What MACD measures
Both moving averages are seeded with a simple moving average and use the standard smoothing factor 2/(N+1), matching the convention used by mainstream charting platforms. The MACD line is a price difference, so it carries the instrument's price units, not a percentage. The signal line is computed over the defined portion of the MACD series, so the warm-up gap is never treated as a run of zeros that would drag the average toward the axis. The histogram is drawn only where both the MACD line and the signal line exist; it never fills a bar by assuming a missing value.
The formula, as implemented
This is not how the indicator is usually defined elsewhere — it is what the shipped code computes, documented next to the implementation:
MACD (Appel) — EMAs à graine SMA (parité helpers/TradingView, α=2/(N+1)) : macd = EMA_fast(close) − EMA_slow(close) signal = EMA_signal(macd) — calculée sur le suffixe défini de macd hist = macd − signal — histogramme, point seulement si les deux sont définis (jamais de valeur inventée) Défauts 12/26/9 (Appel). Sorties : [ligne MACD, ligne signal, histogramme].
How to read it
- MACD above zero means the fast average sits above the slow one at that bar; below zero means the reverse.
- Crossings of the MACD line and the signal line are the conventional event, and the histogram is simply the size of the gap being crossed.
- An expanding histogram means the two averages are separating; a contracting one means they are converging, which precedes a crossing but does not guarantee one.
- Divergence between the MACD line and price is read on the line, not on the histogram, since the histogram also moves when only the signal average shifts.
- Because the value is in price units, a reading of 3 on one contract is not comparable to a reading of 3 on another, nor to the same contract after a roll.
Parameters and defaults
Fast defaults to 12 and accepts 1 to 200, slow to 26 and accepts 1 to 500, signal to 9 and accepts 1 to 200. Widening the gap between fast and slow makes the line slower and its excursions larger; narrowing it produces more crossings. Setting the fast period longer than the slow period is accepted by those bounds but inverts the meaning of the sign, since the line then subtracts the faster average from the slower one.
| Parameter | Type | Default | Range |
|---|---|---|---|
| Fast EMA | number | 12 | 1 – 200 |
| Slow EMA | number | 26 | 1 – 500 |
| Signal | number | 9 | 1 – 200 |
What it does not show
Every MACD reading is a comparison of two lagging averages, so the indicator describes what has already happened to the trend balance rather than what is next. In a range it produces repeated crossings with little follow-through, because the two averages keep swapping places around the same price. It is calculated from closes alone: volume, trade size and the aggressor side are entirely absent, so a crossing carries no information about participation. The value scale drifts with the price level, which makes historical comparison unreliable over long periods or across a contract roll.
Related indicators
- RSI — Momentum
- Stochastic — Momentum
- Stoch RSI — Momentum
- CCI — Momentum
- ROC — Momentum
- Williams %R — Momentum
This page in other languages
Frequently asked questions
- Why does the MACD histogram start later than the MACD line?
- The signal line is an exponential average of the MACD line, so it needs its own warm-up after the MACD line exists. The histogram is the difference between the two and is plotted only where both are defined, which is why it begins a number of bars after the MACD line appears.
- What do the 12, 26 and 9 in MACD mean?
- They are periods in bars: a 12-period fast exponential moving average, a 26-period slow one, and a 9-period exponential average of the resulting difference used as the signal line. These are the values Gerald Appel published, and they apply to whatever bar interval the chart is set to, not specifically to days.
- Is MACD a momentum or a trend indicator?
- It sits between the two. The distance between two moving averages describes trend alignment, while the rate at which that distance changes behaves like momentum. Neither reading incorporates volume or order flow, so it describes price structure only.