Trading education · Trading indicators
MACD Indicator: Lines, Histogram and Worked Example
Learn the MACD line, signal line and histogram, including 12/26/9 settings, zero-line crosses, divergence and a transparent numerical example.
Explore the guideThe short answer
MACD compares a fast and a slow exponential moving average. Its signal line smooths that difference, and its histogram measures the gap between the two. A positive histogram can coexist with a negative MACD line because they describe different relationships.
Separate the three components.
MACD stands for Moving Average Convergence/Divergence. In the common 12/26/9 configuration, subtract the 26-period EMA from the 12-period EMA, then calculate a nine-period EMA of that difference. Fidelity: MACD components and default settings documents these conventional settings.
MACD line = EMA(12) − EMA(26)
Signal line = EMA(9) of the MACD line
Histogram = MACD line − signal line
The numbers count periods on the chosen chart. “12” on a daily chart and “12” on a fifteen-minute chart represent very different horizons. Some platforms use alternative signal-line smoothing or display the components differently, so inspect settings rather than assuming every MACD panel is identical.
Unlike RSI, MACD is not bounded between 0 and 100. Its raw values inherit price units, which makes direct comparisons across differently priced instruments misleading.
A EUR/USD example in price units.
Suppose the current fast EMA is 1.1050 and the slow EMA is 1.1030. MACD is 0.0020, equivalent to 20 conventional EUR/USD pips as a price difference. If the signal line is 0.0015, the histogram is 0.0005, or 5 pips. These are indicator distances, not a trade's cash profit.
Now consider another snapshot: MACD is −0.0020 and its signal line is −0.0030. The histogram is +0.0010 even though the MACD line remains below zero. The fast EMA is still below the slow EMA, but their difference is above its own smoothed history.
A shrinking positive histogram means MACD is moving closer to its signal line. It does not necessarily mean price is falling. Price can continue rising while the relationship between its averages changes at a slower rate.
Different crosses describe different events.
| Event | Direct interpretation | Possible failure |
|---|---|---|
| MACD crosses zero | Fast and slow price EMAs exchange their ordering. | A sideways move can repeatedly reverse the ordering. |
| MACD crosses its signal | The difference between price EMAs crosses its own smoother. | A brief change can reverse without a sustained price move. |
| Histogram crosses zero | The same line/signal crossover expressed as bars. | It is not an additional independent confirmation. |
| Price / MACD divergence | Selected price swings and indicator swings disagree. | The trend can persist through several divergences. |
A histogram colour change may mark growth versus shrinkage rather than a zero crossing. Read the platform legend. Two charts can show the same numerical values with different colour conventions, creating an apparent disagreement where none exists.
A crossover can be correct and still lose.
Imagine a completed hourly bullish signal-line crossover. The next tradable price is already above the signal candle's close, after a fast move. A later retracement hits the planned stop before any target is reached. The indicator calculation was correct; the entry/exit hypothesis lost money.
Another failure occurs when a range generates alternating crossovers. A study that ignores spread and enters at the ideal signal price may look much better than a model that buys at ask, sells at bid and includes commission. See position sizing with costs for how execution assumptions enter the arithmetic.
Do not repair a losing sample by changing the fast, slow and signal lengths on the same data until the chart looks good. That process selects for historical fit. Keep a later period untouched and retain the original settings and comparison criteria.
A practical MACD review workflow.
- Confirm the instrument, price feed, timeframe and smoothing settings.
- State whether the observation uses completed candles only.
- Choose one event: zero cross, signal cross or a defined divergence.
- Specify entry timing, stop, target, expiry and any no-trade conditions.
- Review losses, missed fills and costs as well as favourable examples.
Use a chart observation to formulate a testable question. For example: does a particular signal-line cross add useful information after a separately defined trend filter? That can be evaluated. “The MACD looks strong” cannot be reproduced reliably.
Neither a histogram bar nor a crossover determines how much capital is exposed. Check the position-size calculator separately and confirm the instrument's margin requirements.
Work through it yourself.
Follow RSI, moving-average and MACD calculations using an editable practice price series.
Download indicator calculation workbook Excel workbook · editable formulasFree to download without registering. Practice examples explain the method; they do not establish a profitable strategy.
Common MACD questions.
Are 12/26/9 the best settings?
They are a common default, not an optimality claim. A valid comparison needs fixed inputs, stated execution rules and an independent evaluation period.
Can the histogram be positive while MACD is negative?
Yes. If MACD is −0.002 and the signal is −0.003, their difference is +0.001. The histogram compares the lines, while the zero line compares the fast and slow price averages.
Does MACD show overbought and oversold levels?
It has no fixed upper or lower bounds. Treating a raw MACD value as a universal overbought threshold across instruments or timeframes is misleading.
Sources & assumptions.
Prepared by InsomniCapital; see our editorial approach. Sources checked on 2 October 2026. Schematics and hypothetical calculations are labelled educational illustrations. Historical observations identify their source, dates and method separately. Neither is a live quote, trade recommendation or reported trading result.
- Fidelity: MACD components and default settings.
- Fidelity: exponential moving averages.
- Fidelity: RSI definition and calculation.
Educational information only, not personalised investment advice. Leveraged trading carries a high risk of loss. Read our risk disclosure. InsomniCapital has an Axi affiliate relationship and may receive compensation for qualifying referrals. References are not endorsements of this guide.