Strategies · Trend and momentum
MACD trend strategy: the signal-line crossover rule, tested
The MACD crossover as a complete trading rule: exact rules, a weekly SPY backtest with costs, the same rule on 30 stocks and on daily and monthly bars, and where it lost.
On this page
MACD is one of the most used indicators on any chart, and its best-known signal is simple: the MACD line crossing above its signal line is called bullish, and crossing below is called bearish. Read as a strategy, that becomes "own the market while the MACD line is above the signal line". Most descriptions of MACD stop at showing a few crossovers that worked. This lesson follows every crossover and counts.
The main test uses weekly bars of SPY, the oldest S&P 500 exchange-traded fund, over a little more than four years. That is a short period, and the page says what it can and cannot show. In it the rule earned 6.5% a year while buying and holding earned 16.4%. The same rule on 30 large stocks trailed holding on 28 of them. The reason is in what the signal line measures.
The idea
The MACD line is the difference between a fast and a slow exponential moving average of the price, by default 12 and 26 periods. When the fast average is above the slow one the line is positive, which means recent prices are higher than older ones: an uptrend.
The signal line is a 9-period exponential average of the MACD line itself. So the MACD line being above its signal line means the gap between the two price averages is wider than it has been lately. That is a statement about acceleration. The trend is not merely up; it is strengthening.
This difference matters for a strategy.
- MACD above zero asks "is there an uptrend?" It is the same question a moving average crossover asks.
- MACD above its signal line asks "is the trend gaining speed?" A healthy uptrend that slows from fast to steady fails this test, and the rule sells, even though prices are still rising.
A rule built on acceleration reacts early, which is its attraction. It also leaves every trend before the trend ends, usually to buy back higher.
The rules
On weekly bars, checked after the last close of each week:
- Compute the MACD line: the 12-week exponential average of the close minus the 26-week exponential average.
- Compute the signal line: the 9-week exponential average of the MACD line.
- If the MACD line is above the signal line, hold the fund for the next week.
- If it is at or below the signal line, hold cash for the next week.
Two variants are tested beside it:
- Zero line. Hold the fund while the MACD line is above zero.
- Both. Hold the fund only while the MACD line is above the signal line and above zero.
Weekly bars are used because the price history available for these lessons has five years of them, against two years of daily bars. The same rules on daily and monthly bars are in the settings table below.
A worked example
In the week of October 31, 2022 the MACD line crossed above its signal line and the rule bought SPY at $376.35. Both lines were below zero at the time: the market was still in a downtrend, but the decline was slowing. This is the early entry that makes the signal attractive, and here it worked. The rule held for ten months.
In the week of August 21, 2023 the MACD line fell below the signal line and the rule sold at $439.97, a gain of 16.7% after costs. SPY was well above where it had been a year earlier, and the MACD line was still above zero. The uptrend had slowed, not ended. The line crossed back up in the week of November 20, 2023, and the rule bought at $455.30, 3.5% above its sale.
What the backtest shows
The test, stated in full:
- Data. SPY weekly closes from November 2021 to the week of November 9, 2026. The first 33 weeks build the averages, so the test runs from July 2022: 228 weeks, about 4.4 years.
- Trading. The signal and the trade both use the week's last close.
- Costs. 0.10% of the amount on every buy and every sell.
- Left out. Dividends, interest on cash and taxes.
- What the period is. A strong bull market with one sharp fall, in early 2025. There is no long decline in it. A test this short shows how the rule behaves in one kind of market and cannot show whether it works over a full cycle.
| Measure | MACD rule | Buy and hold |
|---|---|---|
| Total return | 31.5% | 94.1% |
| Return per year (CAGR) | 6.5% | 16.4% |
| Deepest fall from a peak | −14.0% | −17.1% |
| Longest time below a peak | 68 weeks | 41 weeks |
| Time invested | 59% | 100% |
| Round-trip trades | 9 | 1 |
| Trades with a gain | 56% | n/a |
The five winning trades gained 7.9% on average and the four losing trades lost 2.4%. Costs were a small part of the gap: with no cost the rule returns 6.9% a year. The gap comes from the 41% of weeks spent in cash while the market rose.
The two halves of the period
| Period | MACD rule | Buy and hold |
|---|---|---|
| July 2022 – September 2024 | 7.8% a year | 18.3% a year |
| September 2024 – November 2026 | 5.2% a year | 14.5% a year |
The shortfall is about the same in both halves, so it does not come from one bad stretch.
Where it fails: the losing periods
The rule's pattern in a rising market is to sell when the rise slows and buy back later at a higher price.
| Sold (week of) | Bought back (week of) | Result |
|---|---|---|
| September 19, 2022, $367.95 | October 31, 2022, $376.35 | Bought back 2.3% higher |
| August 21, 2023, $439.97 | November 20, 2023, $455.30 | Bought back 3.5% higher |
| April 15, 2024, $495.16 | June 10, 2024, $542.78 | Bought back 9.6% higher |
| July 22, 2024, $544.44 | September 23, 2024, $571.47 | Bought back 5.0% higher |
| October 28, 2024, $571.04 | November 4, 2024, $598.19 | Bought back 4.8% higher |
| December 23, 2024, $595.01 | May 12, 2025, $594.20 | About even: the rule's good case |
| November 17, 2025, $659.03 | April 20, 2026, $713.94 | Bought back 8.3% higher |
| July 20, 2026, $738.93 | August 3, 2026, $773.26 | Bought back 4.6% higher |
The one useful exit was December 2024. The rule was in cash through the fall of February to early April 2025, when buy and hold lost 17.1% from peak to trough. It then bought back in May at almost exactly its selling price, so it avoided the fall and gained nothing in price from doing so.
The rule's own deepest fall, 14.0%, came at the start: it bought in July 2022, sold in September 7.1% lower, and re-entered at the end of October.
Other ways it fails or misleads:
- It is not a trend filter. Most of its purchases were re-entries into an uptrend it had just left. The signal line cannot tell a pause from a reversal.
- Sideways markets. On IWM, a small-company fund that moved in a wide range for much of the period, the rule made 11 round trips and returned 0.8% a year against 11.1% for holding.
- Taxes. Every sale at a gain within a year is taxed as ordinary income in a US taxable account (IRS Topic 409). This rule's holdings rarely last a year.
- Published evidence is mixed. Chong and Ng found MACD rules profitable on London's FT30 index over 60 years. That study predates this test's period and used different rules of comparison; one supportive study is not a guarantee of anything.
The same rule on 30 stocks
One fund over four years is a small sample, so the same weekly rule was run on each of the 30 stocks that made up the Dow Jones Industrial Average in late 2024.
| Measure, average of 30 stocks | MACD rule | Buy and hold |
|---|---|---|
| Total return | 33.0% | 107.0% |
| Deepest fall | −31.2% | −33.5% |
| Time invested | 53% | 100% |
The rule beat holding on 2 of the 30 stocks and had a smaller worst fall on 19. Across 312 trades, 42% gained; the average gain was 15.6% and the average loss 6.8%. Results ranged from a loss of 64.9% on Nike to a gain of 402.0% on Nvidia, which is a reminder that the stock mattered far more than the rule. These are today's index members, chosen with hindsight, so both columns are flattered equally; the comparison between them is what counts.
Neighbouring settings
Return per year for each version, with buy and hold over the same bars in the last column:
| Bars and fund | Signal line | Zero line | Both | Buy and hold |
|---|---|---|---|---|
| Weekly SPY, 2022 to 2026 | 6.5% | 9.1% | 4.6% | 16.4% |
| Weekly QQQ, 2022 to 2026 | 6.2% | 15.0% | 6.3% | 21.0% |
| Weekly IWM, 2022 to 2026 | 0.8% | 1.1% | −3.9% | 11.1% |
| Daily SPY, 2025 to 2026 | 1.0% | 6.7% | −0.3% | 12.5% |
| Daily QQQ, 2025 to 2026 | 5.9% | 11.2% | 5.8% | 14.0% |
| Daily IWM, 2025 to 2026 | −1.2% | 16.6% | 2.2% | 10.7% |
| Monthly SPY, 1995 to 2026 | 5.9% | 9.0% | 4.9% | 8.5% |
The signal-line rule trailed buying and holding in all seven rows. The zero-line rule did better than the signal-line rule in all seven and beat holding in two. On monthly SPY it returned 9.0% a year against 8.5% with a deepest fall of 24.8% against 52.2%, but it made only three round trips in 31 years, so that row is three events, not a pattern. On daily bars the signal-line rule made 22 round trips on SPY in under two years and 32% of them gained.
The consistent finding is the ordering: the acceleration signal lost to the plain trend signal everywhere it was tried.
Compared with its neighbours
| Rule | What it measures | Trades | In this section's tests |
|---|---|---|---|
| MACD above its signal line | The trend speeding up | Many | Trailed holding in every test here |
| MACD above zero (12/26 EMA crossover) | The trend's direction | Few | Close to other moving-average rules |
| 50-day above 200-day average | The trend's direction | Few | See Golden cross strategy: the 50/200-day moving average crossover, tested |
How Finabase does it
No Finabase tool tells you to buy or sell on a MACD cross. These show and test the indicator.
- Chart. The MACD study draws the MACD line, the signal line and the histogram with the standard 12, 26 and 9 settings, and you can change them. On a five-year chart the bars are weekly, which matches this page's test; the link above opens it. The MACD indicator: signal line, histogram and divergence lesson explains each line.
- Backtest. The Backtest tool includes MACD among its signals; the sample backtest combines MACD, RSI and Parabolic SAR on AAPL. Its results differ from this page's for two reasons: each signal buys a fixed $10,000 instead of reinvesting the account, and no trading cost is charged. It can also go short on bearish signals, which this page's long-or-cash test does not.
- Strategy. The Strategy tool replays if/then allocation rules over two years of daily prices. For a rule that trades this often, two years gives a fair picture of its behaviour in the current market and no information about other kinds of market.
Frequently asked questions
Is the MACD crossover a profitable strategy?
Not in these tests. Holding SPY only while the weekly MACD line was above its signal line returned 6.5% a year from 2022 to 2026 against 16.4% for holding throughout, and the rule trailed on 28 of 30 large stocks. The period was a bull market, which is the hardest setting for any rule that spends time in cash.
Which is better, the signal-line cross or the zero-line cross?
In every test on this page the zero-line version did better. It trades less and stays invested through pauses in an uptrend. It is also slower: it is a 12-period and 26-period moving average crossover under another name.
Does MACD work better on daily or weekly charts?
Neither stood out. On daily bars the signal-line rule traded 22 times in under two years on SPY and gained 1.0% a year; on weekly bars it traded 9 times in four years and gained 6.5% a year. Both trailed holding by about ten points a year.
Why did the rule sell during an uptrend?
Because the signal line measures change in the trend's strength. When a fast rise settles into a slower one, the MACD line falls toward its own average and crosses below it, although prices are still rising.
Summary
The MACD signal-line rule holds a fund while the MACD line is above its signal line. On weekly SPY bars from July 2022 to November 2026 it returned 6.5% a year after costs against 16.4% for buying and holding, was invested 59% of the time, and bought back higher after seven of its eight sales. It trailed holding on 28 of 30 large stocks and in every combination of fund and bar size tried. The cause is structural: the signal line detects a trend that is slowing, and uptrends slow many times without ending. The test period contains no long bear market, where time in cash would have helped, so it shows the rule's cost in good markets and not its possible benefit in bad ones.
Check your understanding
4 questions on this lesson. Each answer comes with the reason, and nothing is scored.
A stock has risen steadily for months. Its rise slows from 3% a week to 1% a week. What is the MACD signal-line rule likely to do?
- Stay invested, because the price is still rising
- Sell, because the MACD line falls below its signal line when a trend loses speed
- Buy more
Show the answer
B. Sell, because the MACD line falls below its signal line when a trend loses speed The signal line is an average of the MACD line, so the cross measures whether the gap between the price averages is widening or narrowing. A slower rise narrows it, and the rule sells into a market that is still going up.
After 7 of its 8 sales on SPY the rule bought back at a higher price. What does that say about the period tested?
- It was a rising market in which pauses did not turn into declines
- Trading costs were too high
- The rule’s settings were wrong
Show the answer
A. It was a rising market in which pauses did not turn into declines Time in cash only pays when prices fall further after the sale. From 2022 to 2026 they mostly did not. The test shows the rule’s cost in a bull market; it contains no long bear market to show a benefit.
Why was the same rule also run on 30 stocks?
- To find the stock where it works best
- One fund over four years is a small sample; many symbols show the spread of outcomes
- Because stocks have MACD and funds do not
Show the answer
B. One fund over four years is a small sample; many symbols show the spread of outcomes A single result can be luck. Across 30 stocks the rule beat holding on 2 and trailed on 28, which is harder to explain by chance. Reporting only the best symbol would be the opposite of this.
In every row of the settings table, "MACD above zero" did better than "MACD above its signal line". What is the difference between the two?
- The zero-line rule checks the direction of the trend; the signal-line rule checks whether it is speeding up
- The zero-line rule uses more data
- There is no real difference
Show the answer
A. The zero-line rule checks the direction of the trend; the signal-line rule checks whether it is speeding up MACD above zero means the 12-period average is above the 26-period average: an uptrend. Above the signal line means the uptrend is strengthening. Trends pause far more often than they end, so the second test is failed far more often.
Sources and further reading
- Gerald Appel, Technical Analysis: Power Tools for Active Investors (FT Press, 2005) — MACD by its originator
- Terence Tai-Leung Chong and Wing-Kam Ng, “Technical analysis and the London stock exchange: testing the MACD and RSI rules using the FT30,” Applied Economics Letters 15(14), 2008
- IRS — Topic no. 409, Capital gains and losses
- Finabase chart data — weekly bars for SPY, QQQ, IWM and 30 Dow stocks, November 2021 to November 2026; daily bars for two years; SPY monthly bars from 1993; rules and results computed by Finabase
