Daily MACD Golden Cross Buys on US Stocks|3 Exits Compared
ENTRIQ backtest of buying after the MACD(12, 26, 9) golden cross on daily charts of 100 US stocks (5–56 years each), with figures for 3 exit patterns.
These are the results of backtesting 100 stocks in ENTRIQ (5 to 56 years of data depending on the stock) (Dataset v1.0).
What is a MACD golden cross?
MACD is a momentum indicator made up of the difference between a short-term and a long-term exponential moving average (the MACD line) and a moving average of that difference (the signal line). A MACD golden cross (the MACD line crossing above the signal line) is when the MACD line crosses the signal line from below, and it is known as a point that suggests momentum has turned upward.
One thing to note is that this is not the same as a moving-average golden cross. A moving-average golden cross is when a short-term MA (e.g. SMA50) crosses above a long-term MA (e.g. SMA200), whereas a MACD golden cross looks not at moving averages of the price itself but at "changes in the difference between the short-term EMA and the long-term EMA." MACD is generally considered to give turning signals earlier than moving-average crosses, so the premise for using it is different. Moving-average crosses are covered separately in Golden Cross & Death Cross|Backtest Your MA Signals.
In this article, the test was set up as "buy at the open on the next trading day after a MACD golden cross, and compare the results across 3 exit patterns."
Test conditions
- Universe: 100 US stocks selected from the current S&P 500 constituents, taking the largest by market cap with up to 15 stocks per sector
- Period: The full history available for each stock (5 to 56 years depending on the stock). Only stocks with at least 5 years of data are included
- Timeframe: Daily (split-adjusted)
- MACD setting: Short-term EMA 12, long-term EMA 26, signal 9
- Entry: Buy at the open on the next trading day after the MACD line crosses above the signal line
- Concurrent positions: New signals in the same stock while a position is open are skipped (only one position at a time)
Exit patterns (3):
- Pattern A (A_signal): Exit at the open on the next trading day after the MACD line crosses below the signal line (MACD death cross) (if it doesn't, exit at the close on the 60th trading day). No stop loss
- Pattern B (B_10bars): Exit at the close on the 10th trading day after entry. No stop loss
- Pattern C (C_stop5): Stop loss at -5%. If the stop isn't hit, exit at the close on the 10th trading day. If the stock gaps down at the open, the fill is at that open price, so a single trade's loss can exceed -5%
About survivorship bias: This test uses data for the stocks currently in the S&P 500. Stocks that were delisted or removed from the index in the past are not included. Results would differ if the same rules had been run in the actual historical market. Please read the figures with this in mind.
Overall results
The main metrics for the 3 patterns are shown side by side.
| Metric | A (MACD death cross) | B (10 trading days) | C (-5% stop + 10 trading days) |
|---|---|---|---|
| Sample size | 38,018 | 33,025 | 34,523 |
| Share of trades closed in profit | 39.2% | 53.3% | 48.2% |
| Average P/L | +0.70% | +0.51% | +0.38% |
| Average gain on trades closed in profit | +7.29% | +4.85% | +4.88% |
| Average loss on trades closed at a loss | -3.61% | -4.55% | -3.87% |
| Profit factor | 1.32 | 1.25 | 1.19 |
| Largest loss | -85.9% | -49.6% | -34.4% |
| Median MAE (maximum adverse excursion) | -2.51% | -3.07% | -3.11% |
| Longest losing streak (within a stock) | 18 | 12 | 15 |
| Average holding period | 12.4 trading days | 10.0 trading days | 8.4 trading days |
Note: Past sample (N=38,018, N=33,025, N=34,523); not indicative of future results.
Comparing the patterns:
The share of trades closed in profit was highest in pattern B, next in C and lowest in A. On the other hand, average P/L and profit factor were highest in pattern A, next in B and lowest in C.
Pattern A has the longest holding period and is structured to capture large moves when a trade goes well. Accordingly, its average loss on trades closed at a loss was the smallest of the 3 patterns, while, with no stop loss, its largest loss was also the largest of the three (-85.9%).
Pattern B has a simple structure with no stop loss and a uniform exit after 10 trading days. Its share of trades closed in profit was the highest, but its average loss on trades closed at a loss was larger than pattern A's, and its largest loss was also larger than pattern C's.
Pattern C is designed to limit losses to some extent with a -5% stop loss. Its largest loss was smaller than A's and B's, while its median MAE was more negative than A's and B's. However, if the stock gaps down at the open past the stop level, losses beyond -5% occur. Its average holding period was the shortest of the 3 patterns.
Results by market regime
The results were split into "uptrend," "downtrend" and "range." An uptrend means the close is above SMA200 and SMA200 is higher than it was 20 trading days earlier, a downtrend is the opposite, and anything else is classified as a range.
Pattern A (exit on MACD death cross)
| Trend | N | Share of trades closed in profit | Average P/L | PF | Median MAE |
|---|---|---|---|---|---|
| Uptrend | 21,939 | 38.1% | +0.45% | 1.25 | -2.22% |
| Downtrend | 8,933 | 41.0% | +1.20% | 1.41 | -3.35% |
| Range | 6,436 | 40.6% | +0.80% | 1.36 | -2.70% |
Note: Past sample (N=21,939, N=8,933, N=6,436); not indicative of future results.
In pattern A, the share of trades closed in profit, average P/L and profit factor were all highest in downtrends, next in ranges and lowest in uptrends. The median MAE (maximum adverse excursion) was most negative in downtrends and least negative in uptrends. In downtrends, the average holding period until exit was the longest at 15.6 trading days, and the average gain on trades closed in profit (+10.01%) was also larger than in the other regimes. Because the exit in pattern A is not fixed until the death cross occurs, price moves can be larger when positions are held longer. That said, the data alone cannot show why the average gain on trades closed in profit was larger in downtrends. Losses were also larger in downtrends (average loss on trades closed at a loss -5.00%), and with no stop loss, the largest loss was also larger than in uptrends.
Pattern B (exit after 10 trading days)
| Trend | N | Share of trades closed in profit | Average P/L | PF | Median MAE |
|---|---|---|---|---|---|
| Uptrend | 18,967 | 53.2% | +0.37% | 1.19 | -2.85% |
| Downtrend | 7,764 | 53.6% | +0.80% | 1.32 | -3.59% |
| Range | 5,663 | 53.5% | +0.55% | 1.27 | -3.18% |
Note: Past sample (N=18,967, N=7,764, N=5,663); not indicative of future results.
In pattern B as well, average P/L and profit factor were highest in downtrends, next in ranges and lowest in uptrends. Differences in the share of trades closed in profit between regimes were small, and in all 3 regimes more than half of the trades were closed in profit.
Pattern C (-5% stop loss + exit after 10 trading days)
| Trend | N | Share of trades closed in profit | Average P/L | PF | Median MAE |
|---|---|---|---|---|---|
| Uptrend | 19,612 | 49.4% | +0.29% | 1.16 | -2.88% |
| Downtrend | 8,338 | 45.4% | +0.54% | 1.24 | -3.64% |
| Range | 5,911 | 48.6% | +0.42% | 1.21 | -3.20% |
Note: Past sample (N=19,612, N=8,338, N=5,911); not indicative of future results.
In pattern C, the share of trades closed in profit was highest in uptrends, next in ranges and lowest in downtrends. On the other hand, average P/L and profit factor were highest in downtrends. Downtrends combined the lowest share of trades closed in profit of the 3 regimes with the highest average P/L and profit factor. The number of trades that hit the stop loss is not included in this breakdown, so it cannot be determined why this combination occurred.
Results by volatility and around earnings
By volatility (pattern A)
Volatility is classified as high when ATR(14) divided by the close is in the top 20% over the stock's full history, low when it is in the bottom 20%, and normal otherwise.
| Volatility | N | Share of trades closed in profit | Average P/L | PF | Median MAE |
|---|---|---|---|---|---|
| Low volatility | 7,451 | 38.8% | +0.59% | 1.47 | -1.56% |
| Normal | 22,981 | 39.4% | +0.67% | 1.34 | -2.50% |
| High volatility | 7,586 | 38.8% | +0.87% | 1.24 | -4.55% |
Note: Past sample (N=7,451, N=22,981, N=7,586); not indicative of future results.
In pattern A, profit factor was highest in low volatility, next in normal and lowest in high volatility. Average P/L was the reverse: highest in high volatility and lowest in low volatility. In high volatility, the average gain on trades closed in profit was large, while the median MAE (maximum adverse excursion), average loss on trades closed at a loss and largest loss were also all the largest (more negative) in high volatility, so the figures show that the range of price moves itself was wide. The share of trades closed in profit was highest in normal volatility, with high and low volatility at the same level.
Around earnings (pattern A)
The 5 trading days before and after an earnings date are classified as "near earnings," and all other days as "away from earnings." Earnings date data is used only from 2008 onward. Trades before then are treated as "unclassified" and excluded from the near-earnings and away-from-earnings figures.
| Bucket | N | Share of trades closed in profit | Average P/L | PF | Median MAE |
|---|---|---|---|---|---|
| Away from earnings | 13,450 | 40.5% | +0.84% | 1.43 | -2.31% |
| Near earnings | 2,969 | 43.3% | +0.86% | 1.43 | -2.46% |
Note: Past sample (N=13,450, N=2,969); not indicative of future results.
In pattern A, both the share of trades closed in profit and average P/L were higher "near earnings" than "away from earnings." Profit factor was the same in both buckets. The median MAE (maximum adverse excursion) was slightly larger (more negative) near earnings, while the largest loss was larger "away from earnings."
Limitations and caveats
This backtest has several structural limitations.
Survivorship bias: As noted above, only stocks currently in the S&P 500 are included. Stocks that were delisted or removed from the index in the past are not included, so the results may be skewed in a more favorable direction than actual historical results.
Slippage and commissions: Entry is assumed at the open on the next trading day, but in actual trading, the choice between limit and market orders and commissions affect results.
Concurrent position limit: New signals in the same stock while a position is open are skipped, so in actual trading you would need to manage capital allocation and multiple stocks.
Characteristics of MACD: MACD is an indicator that captures "changes in momentum" rather than trend reversals. There are cases where the stock's direction does not change even after a golden cross, and periods when signals occur repeatedly. Results change depending on whether you act on the condition alone or combine it with other conditions.
Summary
This article organized the results of buying on the next trading day after a MACD(12, 26, 9) golden cross, tested with 3 exit patterns.
- The share of trades closed in profit was highest in pattern B, followed by pattern C. Pattern A was in the high 30% range
- Average P/L and profit factor were highest in pattern A; this may reflect its structure of holding without a stop loss until the MACD death cross
- By market regime, average P/L and PF were highest in downtrends in all 3 patterns. However, in downtrends the size of losses and MAE also tended to be larger
- In high volatility, the range of price moves was wide, and profit factor was lower than in low volatility (pattern A)
- Near earnings, the share of trades closed in profit and average P/L were higher than away from earnings, and profit factor was the same in both buckets (pattern A)
These are observations of historical data only, and the same results will not necessarily appear in future markets. Before incorporating the MACD golden cross into your own approach, one option is to check actual price moves hands-on with ENTRIQ's Chart Replay. You can accumulate and organize your test results with Strategy Tags.
Frequently asked questions (FAQ)
Q. How is a MACD golden cross different from a moving-average golden cross?
A. A moving-average golden cross is when a short-term MA crosses above a long-term MA. A MACD golden cross is when "the difference between the short-term EMA and the long-term EMA (the MACD line)" crosses above its moving average (the signal line), and it focuses on changes in price momentum. MACD is generally considered to give signals earlier than moving-average crosses, but it also tends to produce signals frequently.
Q. Since pattern A has no stop loss, doesn't it produce large losses?
A. In this backtest as well, with no stop loss in place, the largest loss for pattern A (-85.9%) was the largest of the 3 patterns. Since the design holds positions without a stop loss, it is worth evaluating the condition with that design in mind.
Q. Why are the results better in downtrends?
A. The data confirms that the average gain on trades closed in profit was larger in downtrends. However, in downtrends the size of losses and MAE also tended to be larger. It is difficult to determine the causes behind the results from historical data alone, and multiple factors such as market conditions and stock characteristics may be involved.
Q. Do the results change if the MACD parameters (12, 26, 9) are changed?
A. In general, changing the parameters changes how often and when signals occur, so the results change as well. This article tests the standard 12, 26, 9. To find which parameters suit your own stocks and timeframe, you need to actually change the conditions and test them.
Q. Can I use these results as they are?
A. This article organizes observations under specific historical conditions. Results change depending on the stocks, period, timeframe and combination with other conditions. You need to test again under your own conditions, taking into account survivorship bias and the impact of commissions.
This article is provided for informational purposes to examine and organize historical data and does not recommend any specific trade. The figures shown are past samples and do not indicate future results. All investment decisions are your own responsibility.
Test the same condition used in this article on symbols of your choice.
Backtest this conditionReproduce this validation yourself
With ENTRIQ's chart replay, you can trade through past charts using the same rules.
Try the demo — no sign-upNo sign-up or card needed. Runs right in your browser. Start 14-day free trial →
Validate your method on past charts
The same validation in this article can be reproduced with your own method. On past charts, do the classics really work?
- ✓ Replay past charts
- ✓ AI feedback on your trades
- ✓ Validate methods with statistics
No sign-up or card needed. Runs right in your browser.