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.

By Updated 5 min read
Saved resources

Trading AcademyModule 4: Understand indicator calculationsLesson 20 of 40Not completed

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.

  1. Read a currency quoteNot completed
  2. Choose an order instructionNot completed
  3. Identify the costs of executionNot completed
  4. Separate margin from riskNot completed
  5. Read account equity and closeout rulesNot completed
  6. Compare styles and commitmentsNot completed
  7. Read session times correctlyNot completed
02Stops, sizing and risk6 lessons · Not started

Connect price distances and contract assumptions to cash exposure, payoff and drawdown.

  1. Measure a stop distanceNot completed
  2. Calculate a position sizeNot completed
  3. Convert JPY pip valuesNot completed
  4. Include costs consistentlyNot completed
  5. Separate payoff from expectancyNot completed
  6. 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.

  1. Describe swings without hindsightNot completed
  2. Read the candle before the labelNot completed
  3. Mark and test a price zoneNot completed
  4. 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.

  1. Compare SMA and EMANot completed
  2. Interpret RSI with its assumptionsNot completed
  3. 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.

  1. Identify the gold productNot completed
  2. Translate gold lots into ouncesNot completed
  3. Calculate a gold trade’s resultNot completed
  4. 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.

  1. Study both sides of a currency pairNot completed
  2. Read an NFP releaseNot completed
  3. Compare like-for-like CPI figuresNot completed
  4. Compare PCE inflation measuresNot completed
  5. Read growth rates and revisionsNot completed
  6. Interpret a survey readingNot completed
  7. Separate spending from quantitiesNot completed
  8. Read the complete policy releaseNot completed
  9. 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.

  1. Write a complete study specificationNot completed
  2. Audit a backtest before trusting itNot completed
  3. Account for a breakout’s executionNot completed
  4. Specify a trend-following studyNot completed
  5. 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.

  1. Review decisions as well as outcomesNot completed
  2. 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.

In this guide 8 sections
Illustrative MACD and signal lines above a histogram with positive and negative bars around zero.
The histogram shows MACD minus its signal line. It is not a separate price series.

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.

Read the relationship that actually changed
EventDirect interpretationPossible failure
MACD crosses zeroFast and slow price EMAs exchange their ordering.A sideways move can repeatedly reverse the ordering.
MACD crosses its signalThe difference between price EMAs crosses its own smoother.A brief change can reverse without a sustained price move.
Histogram crosses zeroThe same line/signal crossover expressed as bars.It is not an additional independent confirmation.
Price / MACD divergenceSelected 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.

  1. Confirm the instrument, price feed, timeframe and smoothing settings.
  2. State whether the observation uses completed candles only.
  3. Choose one event: zero cross, signal cross or a defined divergence.
  4. Specify entry timing, stop, target, expiry and any no-trade conditions.
  5. 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 formulas

Free 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.

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.

Check your understanding

1. MACD is −0.0020 and its signal line is −0.0030. What is the histogram?
2. Under the stated MACD convention, what does its line crossing above zero mean?

Completion records your study of this lesson. Read the evidence standards for how examples and claims are presented.