MACD indicator: settings and signals
MACD shows the divergence of two exponential moving averages of different lengths and the rate at which that divergence changes.
What the indicator looks like on a real chart
Data: EUR/USD, daily bars, 2025-06-16 — 2026-07-20. The indicator is computed over 400 bars; the chart shows the last 180. Quote source: Binance Spot REST API (api.binance.com/api/v3/klines).
| Regime | Score |
|---|---|
| Trending market | 62 |
| Range | 34 |
| High volatility | 48 |
| Low volatility | 45 |
What the indicator actually measures
MACD is not an oscillator in the classic sense but a tool for comparing two speeds. The fast EMA(12) reacts to recent prices, the slow EMA(26) reflects a longer context. Their difference is positive when the short horizon outpaces the long one, i.e. at the moment a move accelerates.
The signal line — an EMA(9) of the MACD itself — adds a second layer of smoothing. The histogram, the difference between MACD and the signal line, turns out to be a second-order derivative of price: it shows not the move and not even its speed but the change in speed. That is why the histogram changes sign before the lines cross, and the lines cross before price reverses.
An important consequence: MACD has no fixed scale. Its values are expressed in price units, so a "high" MACD on one instrument and on another are non-comparable numbers, and comparing historical levels makes sense only within a single asset and a single volatility regime.
Formula
The histogram equals MACD minus the signal line, so it crosses zero at exactly the moment the two lines cross. These are not two different signals but one and the same signal shown two ways.
Standard settings
| Parameter | Value |
|---|---|
| Fast / slow EMA | 12 / 26 |
| Signal line period | 9 |
| Scalping setting | 5 / 13 / 1 |
The 12/26/9 set comes from the era of a six-day trading week: 12 and 26 are roughly two and four weeks. There is nothing optimal about these numbers; they simply became the standard and therefore a self-fulfilling reference. The faster 5/35/5 variant is used for earlier entry at the cost of false triggers.
Implementation code (Python)
def macd_histogram(close, fast=12, slow=26, signal=9):ema_fast = close.ewm(span=fast).mean()ema_slow = close.ewm(span=slow).mean()macd = ema_fast - ema_slowsig = macd.ewm(span=signal).mean()return macd - sig
When the indicator stops working
- In a range the histogram continuously flips sign, producing a stream of meaningless signals.
- The values are not normalized: the MACD level cannot be compared between instruments or between periods of different volatility.
- Double smoothing means double lag — on sharp reversals the signal arrives after a substantial price move.
Common mistakes in use
- Trading every line crossover without a trend filter. That is exactly how MACD turns into a machine for generating commissions in a ranging market.
- Treating a zero-line cross and a signal-line cross as the same event: the first means a change in the sign of the moving-average divergence, the second a change in its dynamics.
- Hunting for divergences on low timeframes, where they appear on almost every pullback and carry no information.
- Comparing the absolute histogram height today and a year ago without accounting for the fact that volatility has changed in the meantime.
Who needs this and why
MACD suits traders working on daily and hourly bars in instruments with pronounced trends. On an instrument that spends most of its time in a range it will produce predominantly false signals.
Frequently asked questions
How does a zero-line cross differ from a signal-line cross?
A zero-line cross means the fast EMA has caught up with the slow one, i.e. the medium-term balance has changed. A signal-line cross happens earlier and only reflects a change in the pace of divergence. The first is a rarer and later signal, the second more frequent and earlier.
Why does MACD have such different values on different instruments?
Because MACD is measured in the price units of the instrument. On a pair priced around one the values will be in hundredths; on an index priced in the thousands, in the tens. Comparing these numbers with each other is meaningless; only the shape of the curve can be compared.
Can MACD be used as the only indicator?
Technically yes, but the result will depend heavily on whether the market is trending. It is more practical to place a market-state filter ahead of MACD — for example ADX or a simple comparison of price with a long moving average — and to accept signals only in the direction of the trend.