Strategies

Does MACD Actually Work? We Backtested 972 Crossovers

Disclosure: some links in this article are affiliate links, if you subscribe through one we earn a commission, at no extra cost to you. It does not change what we recommend, and we say where a product is the wrong choice.

MACD is on almost every chart on the internet, and almost every article about it stops at what the lines mean. The question people actually have is whether trading the crossover would have left them better off, so that is what this page answers first.

We ran the standard 12/26/9 crossover across 22 US stocks and sector ETFs, over the window the free backtester covers, buying when the MACD line crosses above its signal line and selling when it crosses back below, with commission and slippage on. That produced 972 trades, of which 41.1% finished green.

It beat simply buying and holding on 3 of the 22. The median name returned 16.9% over the period against 57.3% for doing nothing.

Unlike a candlestick rule that fires three times a decade, this comparison is a fair one: the crossover is either in the market or out of it, and it was invested about 49% of the time. Half the market exposure, less than a third of the return.

The three where it won were NFLX, AMD and XLRE, which is the useful detail: the crossover did best in the names that trended hardest and chopped least. That is not a coincidence, and it is the whole story of this indicator.

Why it loses, mechanically

MACD is two moving averages of price, so it is a lagging measure by construction, and a crossover system pays a cost every time price changes its mind. In a market that trends, the cost is small relative to the move captured. In a market that oscillates, it is paid over and over with nothing to show for it.

972 trades across 22 names in four and a half years is roughly 44 round trips per stock. Every one of them paid commission and gave up a little to slippage. The indicator did not have to be wrong for that to matter; it only had to be indecisive.

This is the same result the 225 backtests we ran kept producing, and it is worth internalising before adding any indicator to a plan: a signal that is right slightly more than half the time still loses if it trades often enough.

What MACD actually is

Three components, and the third is the one people misread:

  • The MACD line. The 12-period EMA minus the 26-period EMA. It is a distance, not a price: how far the fast average has pulled away from the slow one.
  • The signal line. A 9-period EMA of the MACD line. A smoothed version of that distance.
  • The histogram. The gap between the two. It is a second derivative of price, which is why it turns before both lines do and why it is noisier than either.

A crossover, then, is not "momentum turned positive". It is "the recent gap between two averages crossed its own recent average". Said that way it is obvious why it lags, and why the parameter set is arbitrary. There is nothing sacred about 12, 26 and 9.

Divergence, and what it is worth

Divergence is where price makes a higher high and MACD does not, and it is the part of the indicator people put most faith in.

Its problem is that at the moment it forms, it is indistinguishable from an ongoing trend that has simply slowed. In a strong uptrend, price makes higher highs on decreasing momentum for months at a time, and every one of those is a divergence that did not mark a top.

We used to say here that we had not found a way to express divergence as a testable rule. That is no longer true: the backtester now carries a Divergence rule that reads confirmed swing highs, and we ran MACD-line bearish divergence across 22 US stocks. It took 186 trades, and buying into them won 54.3% of ten-day holds against a 55.4% base rate for the same names and dates, a one-point gap that is statistically nothing. For the MACD specifically, the faith is not repaid: the pattern told you almost nothing about the next ten days. The RSI version did somewhat better, which is a reason to test the indicator you actually read.

Where MACD is genuinely useful

Not as a trigger. As a description.

  • As a filter, not a signal. "Is MACD above its signal line" is a reasonable trend condition to stack on top of a setup you actually trade. It is a poor reason to enter on its own, which is what the 972 trades above measure.
  • As a way to compare two names. The histogram's slope says which of two stocks is losing momentum faster, and that is a real comparison.
  • As a sanity check before a discretionary entry. Buying into a name whose momentum has been falling for six weeks is a decision you should make deliberately rather than accidentally.

Run it yourself

The figures above are one run. Yours will differ, because the window moves and because you will pick a different ticker.

MACD on SPYloading live result…Past result of the mechanical rule, fees on, not a prediction.Open this exact setup in the backtester

Change the ticker, change the periods, add a stop. The experiment we would run first is the filter version: in the rule builder, take a setup you already believe in and add MACD is bullish as a condition, then see whether it improved the result or only cut the number of trades. That is the use this indicator survives.

Scanning for MACD setups live

Backtesting and scanning are different jobs. If you want the crossovers as they happen, across a watchlist, that is a charting platform's work. TC2000 has MACD in its scan builder, so a crossover scan needs no formula, and Finviz has a free MACD screen that is enough to see which names are turning.

Frequently asked questions

Does the MACD crossover strategy actually work? On our test it beat buying and holding on 3 of 22 US stocks and ETFs, over 972 trades with costs included, of which 41.1% finished green. The median name returned 16.9% against 57.3% for doing nothing, from about half the market exposure. It won where trends were strongest and lost where price oscillated.

What do the 12, 26 and 9 settings mean? The MACD line is a 12-period EMA minus a 26-period EMA; the signal line is a 9-period EMA of that difference. The numbers are conventional rather than optimal, which is easy to verify by changing them in the backtester and watching the result move.

Is MACD a leading or lagging indicator? Lagging. It is built from moving averages of past price, so it can only describe what has already happened. The histogram turns earlier than the lines, which is often mistaken for the indicator leading price.

What is MACD divergence? Price making a higher high while MACD makes a lower one, taken as a sign the move is tiring. We tested it mechanically on confirmed swings across 22 US stocks: 186 trades, and the ten days after one were about a point worse than any other ten days, a gap far too small to act on. Strong trends produce long stretches of divergence that resolve upward, so treat it as a question rather than a signal.

Is MACD better than RSI? They answer different questions: MACD describes trend and momentum direction, RSI describes how stretched price is. Neither produced an edge on its own in our testing. RSI-2 mean reversion is the RSI variant with the most published evidence behind it, and it is testable in the same tool.

Before you trade any of this

The figures on this page come from one run over 22 large-cap US stocks and sector ETFs, in a window that was mostly a bull market. The script that produced them is in the repository (backend/scripts/research/candle_study.py) so the run can be repeated rather than trusted. The tool above will show you today's numbers, and they will not match these exactly. Past prices are not a forecast, and nothing here is investment advice.

Test it before you trust itEvery rule in this article can be backtested on real daily prices in seconds, free, no signup.Open the backtester

Backtest figures in our articles are computed by our own engine over real price data: fees and slippage included, shown against buy-and-hold, and live embeds refresh as new data lands.

One useful email a weekWhat our backtests, screens and congress feed surfaced this week, no hype, one click to unsubscribe, nothing else sent.