MACD Explained for Beginners: Signal Line, Histogram and Crossovers
MACD is the 12-period EMA minus the 26-period EMA, with a 9-period signal line and histogram. Learn to read crossovers, divergences and whipsaws with examples.

In this guide
- What Is the MACD Indicator?
- How MACD Is Calculated: The 12, 26, 9 Settings
- MACD vs Signal Line: Crossovers
- Zero-Line Crossovers
- MACD Divergence
- MACD Examples: Putting the Signals Together
- Whipsaws and Other Limitations
- MACD vs RSI
- MACD for Beginners: Combining It With Trend and Risk Management
- Bottom Line
- Sources
MACD, short for Moving Average Convergence Divergence, is a trend-following momentum indicator that shows the gap between a fast and a slow exponential moving average of price. By default it subtracts the 26-period EMA from the 12-period EMA, then plots a 9-period EMA of that result as a “signal line.” When MACD crosses above its signal line, momentum is turning up; when it crosses below, momentum is turning down.
This guide to MACD for beginners breaks the indicator into its three parts (the MACD line, the signal line and the histogram) and walks through a worked calculation with real numbers, so you can see exactly why the lines move.
You will also learn the four main signals (signal-line crossovers, histogram shifts, zero-line crossovers and divergences), why MACD produces whipsaws in sideways markets, how it compares with RSI, and how to combine it with a trend filter and proper risk management.
What Is the MACD Indicator?
MACD was developed by Gerald Appel, a money manager and newsletter writer, in the late 1970s. It became one of the most widely used indicators in technical analysis because it does two jobs in one: it shows the direction of the trend, and it shows whether that trend is gaining or losing momentum.
The name describes what the lines do. When the fast and slow moving averages move apart, they diverge and the MACD value grows. When they move toward each other, they converge and MACD shrinks toward zero.
MACD appears in a separate panel below the price chart. Most platforms show three elements:
- MACD line: 12-period EMA minus 26-period EMA.
- Signal line: a 9-period EMA of the MACD line.
- Histogram: bars showing MACD line minus signal line.
Because it is built entirely from moving averages, MACD inherits their strengths, smoothing and trend clarity, and their weakness: lag.
How MACD Is Calculated: The 12, 26, 9 Settings
MACD uses exponential moving averages (EMAs), which give more weight to recent prices. Each EMA updates with a multiplier:
Multiplier (k) = 2 ÷ (N + 1)
EMA today = EMA yesterday + k × (Close today − EMA yesterday)
For the default settings, the multipliers are:
- 12-period EMA: k = 2 ÷ 13 ≈ 0.1538
- 26-period EMA: k = 2 ÷ 27 ≈ 0.0741
- 9-period signal line: k = 2 ÷ 10 = 0.2
Then:
MACD line = 12-period EMA − 26-period EMA
Signal line = 9-period EMA of the MACD line
Histogram = MACD line − Signal line
The “12, 26, 9” settings were designed for daily charts. Because the 12-period EMA reacts roughly twice as fast as the 26-period one, MACD turns positive when recent prices are rising faster than the longer-term average, and negative when they are falling.
Worked example: three days of MACD
Example: Suppose a stock’s indicators stand at these values at yesterday’s close: 12-period EMA $102.000, 26-period EMA $100.000, so the MACD line is 2.000. The signal line is 1.500, so the histogram is 2.000 − 1.500 = 0.500. Values below are rounded to three decimals.
Day 1: close $106.
- 12-EMA: 102.000 + 0.1538 × (106 − 102.000) = 102.000 + 0.615 = 102.615
- 26-EMA: 100.000 + 0.0741 × (106 − 100.000) = 100.000 + 0.444 = 100.444
- MACD: 102.615 − 100.444 = 2.171
- Signal: 1.500 + 0.2 × (2.171 − 1.500) = 1.500 + 0.134 = 1.634
- Histogram: 2.171 − 1.634 = 0.537 (growing: momentum strengthening)
Day 2: close $99.
- 12-EMA: 102.615 + 0.1538 × (99 − 102.615) = 102.615 − 0.556 = 102.059
- 26-EMA: 100.444 + 0.0741 × (99 − 100.444) = 100.444 − 0.107 = 100.337
- MACD: 102.059 − 100.337 = 1.722
- Signal: 1.634 + 0.2 × (1.722 − 1.634) = 1.634 + 0.018 = 1.652
- Histogram: 1.722 − 1.652 = 0.070 (shrinking fast: a crossover is close)
Day 3: close $97.
- 12-EMA: 102.059 + 0.1538 × (97 − 102.059) = 102.059 − 0.778 = 101.281
- 26-EMA: 100.337 + 0.0741 × (97 − 100.337) = 100.337 − 0.247 = 100.090
- MACD: 101.281 − 100.090 = 1.191
- Signal: 1.652 + 0.2 × (1.191 − 1.652) = 1.652 − 0.092 = 1.560
- Histogram: 1.191 − 1.560 = −0.369
On day 3 the MACD line (1.191) dropped below the signal line (1.560): a bearish signal-line crossover. Notice that MACD is still positive, because the 12-EMA remains above the 26-EMA. The longer trend has not flipped yet; short-term momentum has. Notice too that the fast 12-EMA fell $0.778 on day 3 while the slow 26-EMA fell only $0.247. That difference in speed is what makes MACD move.
MACD vs Signal Line: Crossovers
The signal-line crossover is the most common MACD signal.
- Bullish crossover: the MACD line crosses above the signal line. Short-term momentum is improving relative to its recent average.
- Bearish crossover: the MACD line crosses below the signal line. Momentum is weakening.
Crossovers happen often, especially on lower timeframes, and many are noise. They tend to be more meaningful when they agree with the larger trend: a bullish crossover in an established uptrend, after a pullback, carries more weight than one in the middle of a downtrend. Some traders also give more weight to bullish crossovers that happen well below zero, after a deep decline, and bearish crossovers well above zero, after a big advance.
The MACD histogram
The histogram plots the distance between the MACD line and the signal line as bars. Thomas Aspray is credited with developing it in 1986 to anticipate signal-line crossovers.
- Bars above zero mean MACD is above its signal line; bars below zero mean it is below.
- Growing bars mean momentum is accelerating in that direction.
- Shrinking bars mean momentum is fading and a crossover may be approaching, as on day 2 of the example above, when the histogram fell from 0.537 to 0.070.
- When the histogram crosses zero, a signal-line crossover has occurred.
Because the histogram is the difference between two smoothed lines, its peaks and troughs usually come before the crossovers. Aggressive traders use shrinking histogram bars as an early warning; more conservative traders wait for the actual crossover.
Zero-Line Crossovers
The zero line, or centerline, is where the 12-period EMA and 26-period EMA are equal.
- MACD crossing above zero means the 12-EMA has moved above the 26-EMA, a bullish shift in the intermediate trend.
- MACD crossing below zero means the 12-EMA has moved below the 26-EMA, a bearish shift.
Zero-line crosses are slower than signal-line crosses, so they produce fewer signals and confirm trends later. Many traders use MACD’s position relative to zero as a simple trend filter: favor bullish signals when MACD is above zero, and bearish ones when it is below.
MACD Divergence
A divergence is a disagreement between price and MACD.
- Bearish divergence: price makes a higher high, but MACD makes a lower high. The rally is continuing with less momentum.
- Bullish divergence: price makes a lower low, but MACD makes a higher low. Selling pressure is easing.
Divergences can warn of a turn well before a crossover, but they are unreliable on their own. In a strong trend, MACD can diverge for a long time, sometimes several times, before price finally reverses. A divergence becomes more useful when price confirms it, for example by breaking a trendline or a key support or resistance level.
MACD Examples: Putting the Signals Together
Here is how the signals typically line up through a hypothetical swing in a stock on a daily chart.
- Downtrend: price makes lower lows and MACD stays below zero. Bullish crossovers below zero fail repeatedly as the decline continues.
- Bullish divergence: price makes a new low, but MACD makes a higher low. The histogram’s troughs get shallower.
- Bullish crossover: MACD crosses above the signal line while still below zero. This is an early, higher-risk signal.
- Zero-line cross: a few weeks later MACD crosses above zero as the 12-EMA moves above the 26-EMA. The new uptrend is now confirmed, but price has already risen a fair amount.
- Pullbacks in the uptrend: MACD dips toward its signal line or zero and turns up again, offering continuation entries.
- Bearish divergence near the top: price makes a higher high, MACD makes a lower high, and the next bearish crossover warns that the move is tiring.
Every stage involves a trade-off. Early signals offer better prices but fail more often; later signals are more reliable but give up part of the move.
Whipsaws and Other Limitations
A whipsaw is a signal that reverses soon after it appears, often producing a small loss. MACD whipsaws most in sideways markets, when the two EMAs are close together and the MACD line weaves back and forth across its signal line and zero.
Watch out: When MACD hovers near zero and crosses its signal line every few days, the market is probably ranging. Trading every crossover in those conditions tends to rack up a string of small losses and commissions. Consider standing aside until a clear trend emerges.
Other limitations:
- Lag. MACD is built from moving averages, so it confirms moves after they start. Zero-line crossovers can come well after a turn.
- No fixed range. MACD is unbounded, so it does not have standard overbought or oversold levels.
- Price-dependent values. MACD is measured in price units, so a $500 stock produces much larger readings than a $20 stock. You cannot compare MACD values across securities, or across long periods for one security. The Percentage Price Oscillator (PPO), which expresses the gap as a percentage, solves this.
- Settings matter. Shorter settings react faster and whipsaw more; longer ones are smoother and later. Some traders use 5, 35, 5 for more sensitivity, but the default 12, 26, 9 remains the standard.
- Mixed evidence. Academic reviews of technical trading rules, such as Park and Irwin (2007), found that many reported profits weakened with stricter testing and more recent data.
MACD vs RSI
MACD and the RSI indicator are often used together because they measure different aspects of momentum.
| Feature | MACD | RSI |
|---|---|---|
| Creator | Gerald Appel (late 1970s) | J. Welles Wilder Jr. (1978) |
| What it measures | Gap between a 12- and 26-period EMA | Average gains vs average losses over 14 periods |
| Range | Unbounded, centered on zero | Bounded, 0 to 100 |
| Overbought/oversold levels | None standard | 70/30 (or 80/20) |
| Main signals | Signal-line crossovers, zero-line crosses, histogram, divergence | Extremes, divergence, failure swings, 50-line |
| Best at | Trend direction and changes in trend momentum | Measuring stretched momentum and timing pullbacks |
| Weakness | Lags; whipsaws in ranges | Stays overbought or oversold in trends |
| Comparable across assets? | No (price units) | Yes (same 0–100 scale) |
A common pairing is to use MACD above zero to define an uptrend, then wait for RSI to dip toward 40–50 and turn up as a timing signal for a pullback entry.
MACD for Beginners: Combining It With Trend and Risk Management
MACD works best as one part of a plan, not as a standalone buy and sell machine. A simple framework:
- Define the trend first. Use a higher timeframe or a long moving average such as the 200-day. Only take bullish MACD signals when price is above it, and bearish ones when below.
- Use MACD for timing. In an uptrend, look for a bullish signal-line crossover after a pullback, ideally with MACD near or above zero.
- Confirm with price. A bounce from support or a break above a short-term high strengthens the signal.
- Set your stop before you enter. Place it where the trade idea is wrong, such as below the pullback low, not at an arbitrary percentage.
- Size the position from the stop. Risk a small, fixed share of your account on each trade.
Example: Suppose you have a $20,000 account and a rule of risking 1% ($200) per trade. A stock in an uptrend pulls back to $80, and MACD crosses above its signal line. You place a stop at $76, below the pullback low, so you risk $4 per share. Position size = $200 ÷ $4 = 50 shares, a $4,000 position. If you set a target at $88, the potential reward is $8 per share, a risk-reward ratio of 1:2. If the stop is hit, you lose about $200 plus costs, no matter what MACD shows.
With 1:2 trades, you can be wrong on more than half of them and still roughly break even before costs. That math, not any indicator, is what keeps traders in the game. Our guide to risk management in trading covers the other rules.
Bottom Line
MACD subtracts a 26-period EMA from a 12-period EMA, smooths the result with a 9-period signal line and shows the gap as a histogram. Crossovers and the histogram track shifts in momentum, the zero line tracks the trend, and divergences warn that a move is tiring. Expect lag and whipsaws in sideways markets, use a trend filter, and always set your stop and position size before entering. Explore more tools in our trading guides.
Sources
- StockCharts ChartSchool – MACD (Moving Average Convergence/Divergence Oscillator)
- StockCharts ChartSchool – MACD-Histogram
- StockCharts ChartSchool – Percentage Price Oscillator (PPO)
- StockCharts ChartSchool – Moving Averages: Simple and Exponential
- NIST/SEMATECH e-Handbook of Statistical Methods – EWMA Control Charts
- Journal of Economic Surveys (via RePEc) – Park and Irwin, What Do We Know About the Profitability of Technical Analysis?
- CFTC – Learn and Protect
Frequently asked questions
What is the MACD indicator for beginners in simple terms?
MACD shows the gap between a fast (12-period) and a slow (26-period) exponential moving average of price. When the gap widens upward, upside momentum is building; when it narrows or turns negative, momentum is fading. A 9-period signal line and a histogram help you see those changes.
What is the difference between MACD vs signal line?
The MACD line is the 12-period EMA minus the 26-period EMA. The signal line is a 9-period EMA of the MACD line, so it moves more slowly. When the MACD line crosses above the signal line it is a bullish signal, and when it crosses below it is bearish.
What do the MACD settings 12, 26, 9 mean?
They are the periods of the three exponential moving averages: 12 for the fast EMA, 26 for the slow EMA, and 9 for the signal line. Gerald Appel designed them for daily charts, and they remain the default on almost every platform.
Which is better: MACD vs RSI?
Neither is better overall. MACD is a trend-following tool that is better at showing trend direction and shifts in momentum, while RSI is bounded between 0 and 100 and better for spotting overbought or oversold conditions. Many traders use MACD for the trend and RSI for timing.
Why does MACD give false signals?
MACD is built from moving averages, so it lags price, and in sideways markets the two averages stay close together. That makes the MACD line cross its signal line repeatedly, creating whipsaws. A trend filter and confirmation from price help reduce, but not remove, false signals.
Can MACD be used for crypto and day trading?
Yes, MACD works on any market and timeframe with price data, including crypto and intraday charts. Lower timeframes produce many more crossovers and therefore more whipsaws, so traders often confirm signals on a higher timeframe and keep risk per trade small.