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.
In this lesson
- Calculate the difference between MACD and its signal line.
- Distinguish a zero-line cross from a signal-line cross.
Course outline
The complete course
8 modules. One clear path.
Follow the lessons in order, or return to a topic when you need it. Every lesson is open.
01Market foundations7 lessons · Not started
Start with quotes, orders, costs, exposure and the practical demands of a trading day.
- Read a currency quoteNot completed
- Choose an order instructionNot completed
- Identify the costs of executionNot completed
- Separate margin from riskNot completed
- Read account equity and closeout rulesNot completed
- Compare styles and commitmentsNot completed
- Read session times correctlyNot completed
02Stops, sizing and risk6 lessons · Not started
Connect price distances and contract assumptions to cash exposure, payoff and drawdown.
- Measure a stop distanceNot completed
- Calculate a position sizeNot completed
- Convert JPY pip valuesNot completed
- Include costs consistentlyNot completed
- Separate payoff from expectancyNot completed
- Understand recovery and loss sequencesNot completed
03Read price in context4 lessons · Not started
Work from completed observations to candles, zones and clearly stated pattern boundaries.
- Describe swings without hindsightNot completed
- Read the candle before the labelNot completed
- Mark and test a price zoneNot completed
- Define a chart pattern’s boundaryNot completed
04Understand indicator calculations3 lessons · Not started
Study what moving averages, RSI and MACD calculate before interpreting a signal.
- Compare SMA and EMANot completed
- Interpret RSI with its assumptionsNot completed
- Separate MACD from its histogramNot completed
05Gold products and calculations4 lessons · Not started
Identify the product, translate lots into ounces and work through results and position sizing.
- Identify the gold productNot completed
- Translate gold lots into ouncesNot completed
- Calculate a gold trade’s resultNot completed
- Translate gold lots into cash riskNot completed
06Economic releases and policy9 lessons · Not started
Read currency drivers, inflation, growth and policy announcements with their expectations and revisions.
- Study both sides of a currency pairNot completed
- Read an NFP releaseNot completed
- Compare like-for-like CPI figuresNot completed
- Compare PCE inflation measuresNot completed
- Read growth rates and revisionsNot completed
- Interpret a survey readingNot completed
- Separate spending from quantitiesNot completed
- Read the complete policy releaseNot completed
- Read beyond the FOMC headlineNot completed
07Build and test study rules5 lessons · Not started
Define a reproducible study, audit its assumptions and work through breakout, trend and range examples.
- Write a complete study specificationNot completed
- Audit a backtest before trusting itNot completed
- Account for a breakout’s executionNot completed
- Specify a trend-following studyNot completed
- Specify a range-trading studyNot completed
08Review decisions and evidence2 lessons · Not started
Review the process behind a result and the records needed to assess a performance claim.
- Review decisions as well as outcomesNot completed
- Assess signals and performance claimsNot completed
The 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.
Lesson 20 checkpoint
Put the reading into practice
Work it through
Calculate the histogram when MACD is −0.0020 and its signal is −0.0030. Explain how a positive histogram can coexist with a negative MACD line.
Completion records your study of this lesson. Read the evidence standards for how examples and claims are presented.