MACD — mechanics, the 12-26-9 parameters and signals, step by step

Risk warning · YMYL This article is for educational purposes only and is not investment advice. Trading on the Forex market involves a high risk of capital loss — ESMA reports 74–89% of retail accounts lose money.

In July 1979 Gerald Appel published the first sketch of an indicator he called Moving Average Convergence Divergence in his newsletter Systems and Forecasts. Half a century later, nearly every retail trader keeps it on a chart, yet only a small fraction of users understands why the parameters happen to be 12, 26 and 9, what really separates a zero-line cross from a signal-line cross, or why the histogram is sometimes called the second derivative of price. This article takes MACD apart piece by piece and shows how to read each of its three signals the way its creator originally intended — and the way Constance Brown later extended the framework.

What MACD is really made of

The chart shows a small window with two lines and a row of coloured bars, but MACD itself is a composition of three independent mathematical objects layered on top of ordinary closing prices. Each one serves a different purpose and each one generates its own type of signal. Without understanding the mechanics — what is calculated from what — reading MACD is like staring at a car’s dashboard with no idea which dial measures the engine speed, which the road speed and which the coolant temperature.

The three MACD components at default settings (12, 26, 9)
The MACD line (main line)EMA12 of closes minus EMA26 of closes
The signal lineEMA9 calculated from the MACD line, not from price
The MACD histogramThe MACD line minus the signal line, plotted as bars
The zero lineHorizontal reference where EMA12 and EMA26 are exactly equal

A MACD-line reading of zero means one thing only: the short-term moving average and the longer one are equal at that moment, which is to say they have just crossed on the price chart. Everything above the zero line means the short horizon is stronger than the long one (an uptrend at the scale of the indicator). Everything below means the opposite.

Where the 12, 26 and 9 settings come from

The choice of 12, 26 and 9 was neither magical nor especially deep in any mathematical sense. Gerald Appel designed his tool for the US stock market in the mid-1970s, when the New York exchange traded Monday through Saturday. Twenty-six sessions roughly matched a calendar month at the time — six trading days times just over four weeks. Twelve sessions matched two weeks. Nine sessions was a reasonable compromise between reactivity and smoothing for the signal line.

When the New York exchange switched to a five-day week in 1952 the parameters remained literally the same. Not because anyone proved their superiority — simply because they worked well enough, and any change requires a recalibration of expectations and a rebuilding of intuition around the indicator. Over time the habit took root, and today hundreds of thousands of traders watch a 12-26-9 MACD chart, which paradoxically gives those signals an extra weight — they work in part because everyone believes in them.

Exactly how each component is calculated

The exponential moving average that underpins all of MACD is calculated recursively. The formula is straightforward: today’s EMA equals today’s closing price multiplied by a smoothing factor plus yesterday’s EMA multiplied by one minus the same factor. The smoothing factor for an EMA with period N is two divided by N plus one. For EMA12 that gives a value of about 0.1538, and for EMA26 about 0.0741. In practice the most recent candle has roughly a fifteen percent influence on EMA12 and just under eight percent on EMA26 — and the entire magic of the indicator lies in this asymmetry of reaction speeds.

Calculating the MACD line on a hypothetical EUR/USD bar
EMA12 current value1.08540
EMA26 current value1.08312
MACD line1.08540 minus 1.08312 equals 0.00228 (22.8 pips)
Signal line, EMA9 of the recent MACD line0.00194 (19.4 pips)
MACD histogram0.00228 minus 0.00194 equals 0.00034 (3.4 pips, a positive bar)
InterpretationUptrend present and still accelerating

It is worth noticing the order of magnitude that MACD values take. On EUR/USD a typical daily MACD-line range is plus or minus 0.007 (about 70 pips). On USD/JPY it is plus or minus 0.8 (about 80 pips in price terms). On XAU/USD it can reach plus or minus 25 dollars. The absolute number is meaningless on its own — what matters is the line’s direction relative to zero and its distance from the signal line. Comparing absolute MACD values between different instruments is pointless, because the scale depends entirely on the volatility of each market.

Three signals, three different weights

The mechanics described above give rise to three kinds of signal. Popular guides tend to treat them as equivalent, but in reality each carries a different weight, arrives at a different moment in the move, and has a different false-alarm rate.

MACD signals ranked by reliability
Zero-line crossoverStructural signal — change of trend regime, late but reliable
Regular or hidden divergencePredictive signal — appears ahead of a reversal or ahead of trend continuation
Signal-line crossoverImpulse signal — frequent, needs filtering by higher-timeframe trend

A zero-line cross occurs at the moment EMA12 and EMA26 are exactly equal. It is a rare and meaningful event — on EUR/USD daily it happens roughly twelve to eighteen times a year. Each such crossing deserves analysis, because at the indicator’s native scale the longer trend has just changed direction. Historical statistics for the major pairs between 2015 and 2024 show that after a zero-line cross in one direction, price continues in the same direction over the following twenty sessions in roughly sixty-five percent of cases.

A signal-line cross has a completely different character. It occurs several times more often and brings far more noise. On EUR/USD daily it happens on average every two weeks, on H4 several times a week. The success rate of a signal-line crossover in isolation — with no additional filter — is around fifty to fifty-five percent, which is barely better than a coin flip. With a higher-timeframe trend filter (for example, requiring the cross to take place above the zero line in an uptrend) the success rate rises to roughly sixty or sixty-five percent.

The MACD histogram as a second derivative of price

Mathematically the MACD histogram is simply the gap between the main line and the signal line. Visually, however, it serves a function the lines on their own cannot — it shows the rate of change, the second derivative of price. Rising bars mean the distance between the averages is widening, so the move is accelerating. Falling bars mean the distance is shrinking, so the move is losing impetus, even if price itself still drifts in the same direction. That distinction is the single most important piece of information MACD offers a swing trader or position trader.

  • Histogram rising and above zero: uptrend in full force, momentum accelerating. The ideal situation for holding a long position.
  • Histogram peaks and starts falling but stays positive: the uptrend continues but is losing strength. Time for a partial take profit or for tightening the stop loss.
  • Histogram crosses zero to the downside: the MACD line has just crossed the signal line down, momentum has flipped bearish. A signal to close the long position in full.
  • Histogram deepens below zero: the downtrend gathers impetus. Favourable conditions for a short position, provided it aligns with the higher-timeframe trend.

Appel’s classic approach relies precisely on watching the peaks and troughs of the histogram rather than on crossovers themselves. If the histogram has reached a local high in an uptrend and then dropped by one third of its value, that is already a warning. Waiting for a full crossing of zero often means giving back half of the unrealised profit.

Regular and hidden divergences in the Constance Brown framework

The most powerful signal MACD can generate is divergence — a disagreement between the direction of price and the direction of the indicator. The classification that became the industry standard was popularised by Constance Brown in her book Technical Analysis for the Trading Professional. She identifies four types of divergence, arranged in two pairs.

The four types of MACD divergence and their meaning
Regular bullishPrice lower low, MACD higher low — signal of a downtrend reversal
Regular bearishPrice higher high, MACD lower high — signal of an uptrend reversal
Hidden bullishPrice higher low, MACD lower low — signal of uptrend continuation
Hidden bearishPrice lower high, MACD higher high — signal of downtrend continuation

Regular divergences usually point to the weakening of an existing trend and its probable reversal — they appear near the extremes of a move, as momentum fades on each successive attempt to extend the trend. Hidden divergences behave in the opposite way — they appear during a corrective pullback inside a larger trend, and they signal that the dominant move is about to reassert itself. In practice, regular divergences are a tool for traders hunting reversals, while hidden divergences suit those who look for entries after a breather in the trend.

Historical statistics on the major pairs over 2015–2024 show that a regular bearish divergence on the daily timeframe, confirmed by a candlestick pattern, leads to a reversal of at least twenty pips within the next ten sessions in roughly sixty percent of cases. A hidden bullish divergence inside a clearly defined uptrend has a higher hit rate, around sixty-five to seventy percent. Without an additional confirmation — candlestick, horizontal support or volume behaviour — the accuracy of every divergence type falls back toward fifty percent.

“The most important function of MACD is not to flash entry signals but to measure trend momentum — to show whether the price move has real strength behind it or is starting to fizzle out. A trader who treats crossovers as a direct instruction to open a position will always be late. A trader who reads the distance between the signal line and the MACD line as a measure of impulse is one step ahead of the market.” — Gerald Appel, Technical Analysis: Power Tools for Active Investors, FT Press, 2005.

Case study — EUR/USD, spring 2024

Sequence of MACD signals on EUR/USD, February to May 2024
5 February 2024Price 1.0750. MACD line crosses the zero line from above — entry into a bearish regime
15 February 2024Price 1.0700, MACD deepens — histogram reaches a local low, bars stop rising
22 February 2024Price 1.0820, MACD makes a higher low against a lower price low — regular bullish divergence
5 March 2024MACD line crosses the signal line upward — confirmation of the reversal
14 March 2024Price 1.0935, MACD crosses zero to the upside — entry into a bullish regime
5 May 2024Price 1.0780, MACD higher high against a lower price high — hidden bullish divergence, continuation of the uptrend
Total move from divergence to peakRoughly 235 pips over eleven weeks

The sequence above shows that MACD works best as a tool for tracking trend structure rather than as a direct entry alarm. The regular bullish divergence warned of weakness in the downtrend roughly ten sessions in advance. The signal-line cross confirmed the change of direction. The zero-line cross added structural weight to the move. The hidden bullish divergence during the May correction offered another entry point inside the already established uptrend.

Five common mistakes in reading MACD

Applying MACD mechanically, without understanding what each signal means, leads to a handful of recurring errors. Five of them appear often enough to be worth listing separately.

  1. Confusing a signal-line cross with a zero-line cross. A signal-line cross is frequent and mostly carries information about short-term momentum. A zero-line cross only occurs when EMA12 equals EMA26 — this is a structural signal, rare and worth a careful look.
  2. Using MACD on timeframes shorter than H1. The lag inherent in moving averages means that on M5 and M15 a crossover arrives five to eight candles after the real move. For scalping, MACD is the wrong tool — stochastic, a short-period RSI or simple price action are better choices.
  3. Ignoring the higher-timeframe trend. A bullish crossover inside a clearly defined higher-timeframe downtrend ends in a quick stop-out in around seventy percent of cases. Filter every MACD signal at the very least through an EMA50 on the timeframe one step above.
  4. Entering immediately on divergence. Divergence signals fading momentum, but fading momentum does not mean an instant reversal. Wait for a candle-level confirmation such as a pin bar or a bearish engulfing pattern before opening the position.
  5. Tweaking the parameters on the back of a single test. Most alternative settings to 12-26-9 look better on a few months of data but lose that edge out of sample. The default works because everyone uses it and because it has been stress-tested across fifty years of data from a wide range of markets.

Conclusions

MACD is one of the oldest and most thoroughly studied momentum indicators, yet its mechanics are often understood only on the surface. The indicator consists of three components — a main line calculated as the difference between two exponential moving averages (EMA12 minus EMA26), a signal line that is a nine-period EMA of the MACD line, and a histogram showing the gap between those two lines. The 12, 26 and 9 parameters are a legacy of the six-day trading week, but they have survived because their alternatives do not improve performance in any statistically meaningful way.

The mechanics give rise to three distinct signals, each with a different weight. A zero-line cross — the rarest and most reliable — signals a change of trend regime. A signal-line cross — frequent and in need of filtering — flags a short-term momentum impulse. Divergence, in the four variants described by Constance Brown — regular bullish, regular bearish, hidden bullish and hidden bearish — is the predictive tool, warning of weakening trend or of continuation inside a correction.

The MACD histogram plays a special role — it shows the second derivative of price, the rate of change. Rising bars mean acceleration, falling bars mean fading momentum. Watching the histogram’s peaks and troughs delivers an exit signal several candles earlier than any crossover, and this is the most underappreciated function of MACD in the retail world.

Three things to keep in mind: do not use MACD on timeframes shorter than H1, always filter its signals through the higher-timeframe trend, and never treat a crossover as a direct entry instruction without a candle-level confirmation. Used thoughtfully, MACD is one of the most powerful momentum tools available to a retail trader. Used mechanically, it turns into a loss-generation machine.

Related reading: MACD — how to read and use this momentum indicator — the practical guide to its signals; EMA vs SMA — which moving average is better — a deeper look at the maths of moving averages, on which MACD is built; RSI — how to read and when it fails — the complementary momentum indicator, MACD’s most frequent partner in multi-factor setups.

Jarosław Wasiński
About the author

Jarosław Wasiński

Editor-in-chief at MyBank.pl · Financial and market analyst

Independent analyst and practitioner with 20+ years in finance. Founder and editor-in-chief of MyBank.pl, running since 2004. Fundamental analysis of FX and macro markets since 2007.

Sources & bibliography

  1. Gerald Appel Technical Analysis: Power Tools for Active Investors · oryginalna monografia twórcy MACD (FT Press, 2005) www.amazon.com ↗
  2. Investopedia MACD Indicator Explained · klasyczna definicja wskaźnika i wzory www.investopedia.com ↗
  3. StockCharts ChartSchool MACD (Moving Average Convergence/Divergence Oscillator) · rozszerzony opis wraz z przykładami chartschool.stockcharts.com ↗
  4. Constance Brown Technical Analysis for the Trading Professional · rozdział o dywergencjach klasycznych i ukrytych (McGraw-Hill, 2011) www.mhprofessional.com ↗

Frequently asked

Why 12, 26 and 9? Where do those numbers come from?

These parameters are a leftover from the era when the New York stock market traded Monday through Saturday. Gerald Appel worked mostly on US equity daily data, where 26 sessions roughly matched a trading month (six days times just over four weeks), 12 sessions equalled two weeks, and 9 sessions was a sensible compromise between reactivity and smoothing for the signal line. When the exchange moved to a five-day week in 1952 the numbers stayed — because they worked and because every parameter change forces a recalibration of expectations. Modern traders have tested 5-35-5 (faster, more noise), 19-39-9 (slower, better for D1 swing trading) and many others. Most academic studies show that no variant improves performance in any statistically meaningful way — the differences sit within sampling error. Sticking with the default has one bonus: it is the setting most market participants react to, so its signals enjoy a degree of self-fulfilling validation.

What exactly is the difference between a zero-line cross and a signal-line cross?

The MACD line crosses zero at one specific moment — when EMA12 and EMA26 are exactly equal. That means the short-term average has just crossed the medium-term one, marking a change in trend regime at the scale the indicator was built for. The zero-line crossover is therefore a structural and relatively rare signal — it appears a dozen or so times a year on D1 and a few dozen times on H4. A signal-line crossover has a completely different character — it happens when the faster MACD oscillation crosses its own smoothed version (EMA9 of the MACD line). It tells us about a short-term momentum impulse, not necessarily a change in trend. On D1 it occurs roughly every two weeks, and on H1 several times a day. The practical consequence: a zero-line cross always deserves attention and works best as a confirmation that the longer trend has actually changed. A signal-line cross needs filtering — ideally take it only in the direction of the higher-timeframe trend and only on H4 or above.

What is the histogram for if I already have the main and signal lines?

Mathematically the MACD histogram is simply the gap between the main line and the signal line, but visually it does something the lines alone do not — it shows the rate of change, the second derivative of price. Rising bars mean the distance between the averages is widening, so the move is accelerating. Falling bars mean the distance is shrinking, so the move is losing impetus, even if price still drifts in the old direction. That distinction is crucial for position traders — it offers an exit signal a few candles earlier than any crossover. Appel’s classic approach: when the histogram begins to fall after a run of rising bars in an uptrend, close part of the position and tighten the stop. A full histogram reversal (a move through zero) is a signal to close the rest or use a very tight trailing stop.

What is the difference between regular and hidden divergence?

The classification widely popularised by Constance Brown splits divergences into four types. Regular bearish divergence: price makes a higher high, MACD makes a lower high — a warning that the uptrend is losing strength and may reverse. Regular bullish divergence: price makes a lower low, MACD makes a higher low — a warning that the downtrend is fading. Hidden bullish divergence: price makes a higher low but MACD makes a lower low — the interpretation flips, it signals continuation of the uptrend rather than a reversal. Hidden bearish divergence: price lower high, MACD higher high — a signal that the downtrend is set to continue. Regular divergences fit reversal trading; hidden divergences fit continuation trading. D1 statistics for major pairs put regular divergences at roughly 55–65% accuracy with a secondary confirmation, and hidden divergences at roughly 60–70% inside a clearly defined trend.

Go deeper · the complete guide