The indicators that matter Lesson 4 of 10
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.
The idea
Before the formula, look at where each line comes from. MACD is one measurement taken three times: two averages of price, the gap between them, and the gap between that gap and its own average.
Read it from the top. In panel 1 the 12-day EMA hugs the price and the 26-day EMA follows more slowly. Panel 2 is the distance between those two lines: it is below zero whenever the fast average is under the slow one, and it stops falling as soon as the two averages stop moving apart, which happens before they cross. Panel 3 does to the MACD line what the MACD line did to price, and measures how far it has pulled away from its own 9-day average.
Each step makes the picture smoother and moves it one step further from price. That is the trade the rest of this lesson keeps returning to: MACD is easy to read because it leaves out most of what price did.
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.
One stock at a time, one year of daily closes, no trading costs. The lab computes MACD from these bars only, so its first weeks are blank and it counts 13 Microsoft crossovers where the chart above counts 17. It shows how the settings behave, not which setting is best.
A signal that worked and one that failed
Here is the same signal twice, on the same stock, three months apart. Both are bullish crossovers of the signal line with the MACD line below zero. The shaded area in each chart is the 20 sessions after the crossover.
In the MACD panel the two crossovers look alike. The difference is in what came before them. In April, price had made a lower low while MACD made a higher one, so selling pressure had already been shrinking for six weeks. In January there was no such divergence: price had gone sideways for a month, MACD had drifted up to its signal line and barely cleared it, and both turned down within days. Nothing in the crossover itself separates the two. That is why a crossover is a reason to look at a chart, and not a decision.
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.
Check your understanding
4 questions on this lesson. Each answer comes with the reason, and nothing is scored.
MACD (12, 26, 9) is at −10.8 and its signal line is at −11.1. What is true?
- The histogram is positive, and the 12-day EMA is still below the 26-day EMA
- The histogram is negative, and an uptrend has begun
- MACD is oversold, so a bounce is due
Show the answer
A. The histogram is positive, and the 12-day EMA is still below the 26-day EMA The histogram is MACD minus its signal: −10.8 − (−11.1) = +0.3. MACD below zero means the fast EMA is still under the slow one. MACD has no oversold level, because it is not bounded.
MACD crosses above its signal line while both are well below zero, in a stock that has been falling for weeks. What does the crossover tell you?
- The downtrend is over
- The decline is losing speed; the trend has not turned yet
- The stock is cheap
Show the answer
B. The decline is losing speed; the trend has not turned yet A crossover below zero says momentum has improved inside a trend that is still down. Microsoft gave one on January 7, 2026 and fell 18.6% over the next 20 sessions. The zero line, not the signal line, marks the fast EMA moving above the slow one.
One stock trades near $40 and another near $400. Both show a MACD of 5. Can you say they have the same momentum?
- Yes, MACD is on the same scale for every stock
- Yes, as long as both use the 12, 26, 9 settings
- No, MACD is in price units, so 5 is a much larger move for the $40 stock
Show the answer
C. No, MACD is in price units, so 5 is a much larger move for the $40 stock MACD is the gap between two averages of price, in dollars. A $5 gap is 12.5% of a $40 stock and 1.25% of a $400 one. The percentage version, the PPO, exists to make that comparison possible.
In the lab above, choose Costco and switch from 12 / 26 / 9 to 5 / 35 / 5. What happens?
- Fewer signals, and a larger share of them worked
- More signals, and a smaller share of them worked
- The same number of signals, only earlier
Show the answer
B. More signals, and a smaller share of them worked The faster setting gives 31 signals where the standard one gives 25, and 6 of 15 up signals were followed by a higher close 20 sessions later, against 7 of 13. Faster settings react sooner and more often; they do not make each signal more reliable.
Exercise
One task to do in Finabase. Nothing is graded or saved.
Open the Scanner, choose Indicators and Bullish, and pick the MACD (26, 12) card. It lists stocks whose histogram has just crossed above zero, which is a signal-line crossover. Open three of them on the chart. For each one: is the MACD line itself above or below zero at the crossover, and is the price above its 200-day average (add SMA (200) if the chart does not show it)? Which of the three would you trust least, and why?
Open the ScannerWhat you should find
A crossover with the MACD line below zero, in a stock under its 200-day average, says the decline is losing speed, not that an uptrend has begun. Microsoft’s January and May 2026 crossovers were of that kind and both failed. Those are the ones to trust least. A crossover is a reason to look at the chart, not a decision.
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
