Indicators · Momentum oscillators
MACD indicator: signal line, histogram and divergence
How the MACD line, signal line and histogram are calculated, how to read crossovers, the zero line and divergence on Microsoft’s 2026 chart, and how Finabase scores it.
On this page
MACD, short for Moving Average Convergence Divergence, is one of the most popular indicators on any charting platform. Gerald Appel developed it in the late 1970s. It measures the gap between a fast and a slow exponential moving average of price. When the fast average pulls away above the slow one, upside momentum is building; when it falls back toward or below it, momentum is fading or turning down.
MACD is shown as three things at once: the MACD line, a signal line that smooths it, and a histogram of the difference between the two (added by Thomas Aspray in 1986). Each answers a slightly different question. This guide shows the arithmetic with real Microsoft values, how to read the crossovers, the zero line and divergence, what Microsoft's 2026 chart says about the reliability of each, and how Finabase computes and scores MACD.
What MACD measures
A fast EMA follows price closely; a slow EMA lags behind. In a rising market the fast one moves above the slow one, and the faster the rise, the wider the gap. In a falling market the fast EMA drops below. MACD is that gap, in price units (dollars for a US stock).
That makes MACD a trend-and-momentum hybrid. Its sign tells you the short-term trend relative to the longer one; its slope tells you whether that trend is accelerating or slowing. Its name describes exactly this: the two averages converge (gap shrinking) and diverge (gap growing).
The formula
A worked example on Microsoft
The signal line is an ordinary 9-period EMA of the MACD line, so each day it moves 20% of the way toward the latest MACD value. Here is Microsoft (MSFT) around its April 2026 crossover, using Finabase's values.
| Date | MSFT close | MACD | Signal calculation | Signal | Histogram |
|---|---|---|---|---|---|
| Apr 2, 2026 | $373.46 | −11.52 | (from the chart) | −11.15 | −0.37 |
| Apr 6, 2026 | $372.88 | −10.80 | −11.15 + 0.2 × (−10.80 − (−11.15)) | −11.08 | +0.27 |
| Apr 7, 2026 | $372.29 | −10.17 | −11.08 + 0.2 × (−10.17 − (−11.08)) | −10.90 | +0.73 |
On April 6 the MACD line rose above its signal line, so the histogram flipped from negative to positive: a bullish crossover. Note that the MACD line was still well below zero. The 12-day EMA was still about $11 under the 26-day. The crossover said downside momentum was easing, not that an uptrend had begun.
Reading MACD: four techniques
1. Signal-line crossovers
The MACD line crossing above its signal line (the histogram turning positive) is the most common buy trigger; crossing below is the sell trigger. They are early and frequent. Microsoft's chart had 17 signal-line crossovers in the year to October 29, 2026. Some were excellent:
- April 6, 2026 (bullish, $372.88): +10.9% over the next 20 sessions.
- July 2, 2026 (bullish, $390.49): +19.0% over 20 sessions, helped by the July 30 earnings jump.
Others were costly:
- January 7, 2026 (bullish, $483.47): −18.6% over 20 sessions as Microsoft slid into February.
- May 29, 2026 (bullish, $450.24): −18.1% over 20 sessions into the June low.
Bullish crossovers below the zero line in a falling market, like January's, are the classic trap: momentum improved briefly inside a decline that continued.
2. The zero line
The MACD line crossing zero means the 12-day EMA has crossed the 26-day EMA. It is a slower, trend-confirming signal. Microsoft's MACD crossed zero six times in the year: negative on November 6, 2025, positive on April 16, negative on June 10, positive on July 20, negative on July 23 and positive again on July 30. The whipsaw in late July shows the zero line is not immune to noise either.
3. The histogram
The histogram shows the distance between MACD and its signal. Shrinking bars warn that momentum is fading before the lines actually cross. It is also the first of the three to turn. Many traders read a histogram that stops falling and ticks up, while still negative, as the earliest sign of a turn.
4. Divergence
A bullish divergence is a lower low in price with a higher low in MACD; a bearish divergence is a higher high in price with a lower high in MACD. Microsoft gave a textbook example in 2026:
- February 17: intraday low $394.53, MACD at its low for the year, −18.90.
- March 30: a lower intraday low, $356.28, but a higher MACD low, −13.18.
The selling that took price lower carried less momentum. A week later, on April 6, the MACD line crossed its signal, and by early May Microsoft was above $410. Divergences can repeat before they work, though: on June 25 the stock made yet another lower low, $349.20, with MACD at −14.23, still above February's extreme.
Choosing the settings
| Settings | Use |
|---|---|
| 12, 26, 9 | The standard; Finabase's default |
| 5, 35, 5 | A faster, more sensitive version some swing traders use |
| 19, 39, 9 | Slower, for longer trends |
| 12, 26, 9 on weekly bars | Position trading over months |
Appel himself suggested using different settings for buy and sell signals in some markets. Treat any change as a hypothesis and test it on more than one symbol.
Pitfalls and limitations
Lag. MACD is built from EMAs and an EMA of their difference. Its signals come after the turn in price, sometimes well after.
Not bounded. MACD is in price units, so it cannot be compared across stocks, or across years for the same stock when the price has changed a lot. Overbought and oversold levels do not exist. The percentage version, the PPO, solves that.
Whipsaws in ranges. In sideways markets the two EMAs weave around each other and the crossovers alternate quickly.
MACD compared with related oscillators
| Indicator | Built from | Units | Signal line? |
|---|---|---|---|
| MACD | EMA(12) − EMA(26) | Price | Yes, EMA(9) |
| APO | Fast MA − slow MA | Price | No |
| PPO | (EMA(12) − EMA(26)) ÷ EMA(26) | Percent | Yes |
| TRIX | % change of a triple EMA | Percent | Optional |
| RSI | Average gains vs losses | 0 to 100 | No |
See Absolute Price Oscillator (APO): moving-average gap in dollars for the APO, which in Finabase uses simple rather than exponential averages, and Relative Strength Index (RSI): how to read and use it for a bounded momentum gauge.
How Finabase calculates and scores MACD
Finabase computes MACD with TA-Lib's MACD function on closing prices, with a fast period of
12, a slow period of 26 and a signal period of 9 by default; all three can be changed.
The study title lists the slow period first, MACD (26, 12), a format inherited from the original
Stock Master app. It is drawn in its own panel with the MACD line, the signal line and the
histogram (labelled "Divergence"). MACD is part of the default chart layout.
For the technical gauge on the symbol page and for the Scanner, Finabase reads the histogram: when it is zero or above, MACD counts as Bullish (a buy signal); when it is below zero, Bearish (a sell signal). There is no neutral reading. The Scanner lists the stocks whose histogram crossed zero, which is the same as a signal-line crossover, with the date. Over Microsoft's year the histogram was positive on 113 of 251 sessions. As the examples above show, a crossover is a change in short-term momentum, not a forecast.
Frequently asked questions
What does MACD 12, 26, 9 mean?
The MACD line is the 12-period EMA minus the 26-period EMA of the close, and the signal line is a 9-period EMA of that difference. These are Appel's original settings and the default almost everywhere.
Is a MACD crossover a buy signal?
It is a change in momentum. On Microsoft's 2026 chart some bullish crossovers preceded gains of 10–19% and others losses of 18%. Context, such as the zero line, the longer-term trend and divergence, separates the useful ones from the noise.
What is the MACD histogram?
The difference between the MACD line and its signal line. It turns positive at a bullish crossover and negative at a bearish one, and its shrinking or growing bars show whether momentum is fading or building.
Why is my MACD different from another site's?
Usually because of the starting point of the EMAs, the amount of history used, or adjusted versus unadjusted prices. The differences fade as the EMAs settle.
Summary
MACD tracks the gap between a 12-day and a 26-day EMA, smooths it with a 9-day signal line and plots the difference as a histogram. It captures both the direction and the acceleration of a trend in one panel. On Microsoft's 2026 chart, signal-line crossovers alone were a coin flip with large swings either way, while a clear divergence at the March low pointed to the April rally. Use MACD for context and momentum shifts, and confirm its crossovers with trend and price.
Sources and further reading
- Gerald Appel, Technical Analysis: Power Tools for Active Investors (FT Prentice Hall, 2005) — MACD as developed by its creator
- Thomas Aspray, “MACD Momentum,” Technical Analysis of Stocks & Commodities (1986) — the MACD histogram
- TA-Lib — MACD function reference
- Finabase chart data — MSFT daily bars, 2025-10-30 to 2026-10-29, MACD computed by Finabase