Moneydesks

📶 MACD, its histogram and the percentage version

Open this guide in the app →

🎯 In 30 seconds: MACD is the gap between a fast and a slow exponential moving average. The signal line is a smoothed copy of that gap, and the histogram is the distance between the two. The histogram measures whether the gap is widening or narrowing, so it turns first and gives the earliest, noisiest hints. The zero line is just the point where the two averages cross. Because MACD is in dollars, the percentage version (PPO) is better for comparing stocks or long histories.

Three lines from two averages

Gerald Appel developed MACD in the late 1970s. With the default settings (12, 26, 9):

  • MACD line = 12-bar EMA of closes minus 26-bar EMA of closes.
  • Signal line = 9-bar EMA of the MACD line.
  • Histogram = MACD line minus signal line.

Each EMA updates with a weight of 2 / (n + 1). That is 0.1538 for 12 bars, 0.0741 for 26 bars and 0.2 for the 9-bar signal. The fast average reacts about twice as strongly to each new close as the slow one, which is what opens and closes the gap.

One update by hand

A hypothetical stock, MERI, ends yesterday with a 12-bar EMA of $100.00, a 26-bar EMA of $98.00 and a signal line of 1.60. So yesterday’s MACD was 2.00 and the histogram was 0.40. Today MERI closes at $104.

StepCalculationResult
New 12-bar EMA100.00 + 0.1538 × (104 minus 100.00)100.62
New 26-bar EMA98.00 + 0.0741 × (104 minus 98.00)98.44
MACD line100.62 minus 98.442.17
New signal1.60 + 0.2 × (2.17 minus 1.60)1.71
Histogram2.17 minus 1.710.46

The histogram grew from 0.40 to 0.46 because MACD rose faster than its own average. If MERI had closed flat at $100 instead, the 12-bar EMA would stay at $100.00, the 26-bar EMA would rise to about $98.15, MACD would shrink to about 1.85 and the histogram would drop to about 0.20. One quiet day is enough to shrink the bars.

Why the histogram turns first

Think of the three lines as position, speed and change in speed. The gap between the averages (MACD) tracks the trend. The histogram tracks whether that gap is still growing. A trend can keep rising while it slows down, so the histogram usually peaks before MACD does, and MACD usually peaks before price does.

Two facts tie the lines together:

  • The histogram crosses zero on the same bar that MACD crosses its signal line. They are one event drawn two ways.
  • MACD crosses zero on the same bar that the 12-bar EMA crosses the 26-bar EMA. A zero-line cross is a moving-average crossover, covered in Moving averages in practice.
histogram peaksMACD crosses signalpriceMACDsignal
Hypothetical daily chart with default settings (12, 26, 9). The histogram reached its high early in the rally, while price was still rising. The bearish cross came only when the histogram finally dropped below zero, close to the top. Histogram bars are drawn at three times their true size so they are easy to see.

How people read MACD

EventWhat it saysTiming
Histogram shrinksThe trend is losing speedEarliest, many false alarms
MACD crosses signalShort-term momentum has turnedMiddle
MACD crosses zeroThe fast average is now on the other side of the slow oneLatest, fewest flips
Signal cross far from zeroA turn after a stretched moveOften reads as more meaningful
Signal cross hugging zeroSmall wiggles in a flat marketUsually noise

A common way to combine them: let the zero line set the bias and use signal crosses for timing. While MACD is above zero, only bullish crosses count. While it is below, only bearish ones count. This cuts the number of trades and removes many of the crosses that happen against the trend.

Many traders also run MACD on a weekly chart to judge the larger trend, then time entries on daily bars. The chapter on multiple time frames covers that method.

PPO: the percentage version

The Percentage Price Oscillator uses the same averages but divides by the slow one: PPO = (12-bar EMA minus 26-bar EMA) / 26-bar EMA × 100. The signal line and histogram are built the same way.

Why it matters, with two hypothetical stocks:

  • Stock A trades near $20. Its 12-bar EMA is $20.40 and its 26-bar EMA is $20.00. MACD = 0.40. PPO = 0.40 / 20 × 100 = 2.0%.
  • Stock B trades near $400. Its 12-bar EMA is $404 and its 26-bar EMA is $400. MACD = 4.00. PPO = 4 / 400 × 100 = 1.0%.
MACD (dollars)PPO (percent)0.404.002.0%1.0%$20 stock$20 stock$400 stock$400 stock
Hypothetical. MACD is measured in dollars, so the pricier stock looks ten times stronger. PPO divides by the slow average, and the cheaper stock turns out to have the stronger trend relative to its price.

MACD makes stock B look ten times stronger. PPO shows that A’s fast average sits twice as far above its slow average. The same problem appears on one stock over many years. If a stock grew from $10 to $100, its MACD swings late in the chart will be roughly ten times larger than early on. PPO keeps old and new readings on one scale.

The same recipe applied to volume instead of price is the Percentage Volume Oscillator (PVO). It shows whether recent volume is running above or below its longer average.

Settings

12, 26 and 9 are the standard and what most people see, which is the main argument for keeping them. Shorter settings react sooner and flip more. Longer settings, or the same settings on weekly bars, filter out more noise and arrive later. There is no setting that is correct for every stock. If you change them, change them once for a reason you can explain, not after scanning many combinations for the best past result.

Watch out
MACD has no ceiling or floor, so a high reading cannot be called overbought by its size alone. Compare it only with the same stock’s past readings, or use PPO. In sideways markets the averages tangle and signal crosses flip back and forth every few bars, each one costing a little. And because MACD is built from moving averages, every crossover arrives after the turn it describes. Research on moving-average rules, such as Brock, Lakonishok and LeBaron (1992), found some predictive value in older index data, but later work showed that results weaken once costs and data snooping are taken into account.

MACD is also a common tool for spotting disagreement between price and momentum. That reading has enough traps to need its own chapter: Divergence.

Try it on the chart
Open the Technical Analysis tool on a daily chart. From “+ Indicators” add MACD, then add PPO under it. The shapes should match while the scales differ. Switch the range to several years: the MACD swings should grow as the price rises while PPO stays level. Tick “Chart events” to mark crosses, then count how many signal crosses in a sideways stretch were followed by a real move.
Check yourself
  1. MACD is 1.20 and the signal line is 1.50. What is the histogram, and what has just happened if it was positive yesterday? Answer: minus 0.30. MACD has crossed below its signal line, a bearish signal cross.
  2. MACD just crossed above zero. Which moving averages crossed? Answer: The 12-bar EMA crossed above the 26-bar EMA.
  3. A $50 stock has a 12-bar EMA of $51 and a 26-bar EMA of $50. What is its PPO? Answer: 1 / 50 × 100 = 2.0%.
  4. Why does the histogram often peak while price is still rising? Answer: It measures whether the gap between the averages is growing. A trend that keeps rising at a slower pace makes the gap grow more slowly, so the bars shrink before price turns.

Sources

  • Gerald Appel, Technical Analysis: Power Tools for Active Investors (2005), MACD construction and use
  • John J. Murphy, Technical Analysis of the Financial Markets (1999), MACD and the histogram
  • Brock, Lakonishok and LeBaron (1992), “Simple Technical Trading Rules and the Stochastic Properties of Stock Returns,” Journal of Finance
  • Sullivan, Timmermann and White (1999), “Data-Snooping, Technical Trading Rule Performance, and the Bootstrap,” Journal of Finance
  • Moneydesks Technical Analysis tool: Indicator guide entries for MACD, PPO and PVO