Golden Cross (SMA 50/200) on XLY
Consumer Discretionary Select Sector SPDR Fund: consumer discretionary stocks, a cyclical read on the US consumer. Backtest 2021-01-04 to 2026-10-02, $10,000 starting capital, computed by the same engine that runs live DeployQuant strategies.
The golden cross on XLY turned $10,000 into $10,799 from 2021-01-04 to 2026-10-02, a CAGR of 1.35%. Buy-and-hold on the same fund ended at $14,177, a CAGR of 6.27%. The rule held the fund while the 50-day average was above the 200-day and sold when it fell below. It made 5 round trips in 5.74 years, won 3 of them, and had a profit factor of 1.54. The headline run has no fees or slippage.
XLY is the Consumer Discretionary Select Sector SPDR Fund, a cyclical gauge of the US consumer. It fell 39.67% from 2021-11-19 to 2022-12-28, rose 39.68% in 2023, and fell again in the first months of 2025 and 2026. A trend filter with a 200-day average is built for that kind of path, and the result shows both what it avoided and what it cost. The strategy's maximum drawdown was 25.65%, against 39.06% for holding. The Sharpe ratio was 0.16 against 0.39.
On this fund the template ranks 8th of the 12 in the library, and XLY ranks 33rd of 59 funds for this rule. The median CAGR for the golden cross across all 59 is 2.05%, so XLY is a little below the middle. Among the 6 sector funds the median is 11.2%, and XLY is the lowest of the six, behind SOXX at 28.24%, XLK at 15.33%, VOX at 11.2%, XLF at 3.6% and XLP at 2.05%. The golden cross strategy page has all 59 results, and the XLY fund page ranks the 12 templates on this fund.
Year by year
| Year | golden cross | buy & hold |
|---|---|---|
| 2021 | 6.7% | 28.5% |
| 2022 | −17.3% | −35.7% |
| 2023 | 20.9% | 38.7% |
| 2024 | 26.1% | 26.0% |
| 2025 | −10.5% | 7.3% |
| 2026 | −10.2% | −7.2% |
Year by year against holding the fund
XLY made 28.5% in 2021, lost 35.7% in 2022, made 38.7% in 2023, 26.0% in 2024, 7.3% in 2025 and lost 7.2% in 2026, which is a partial year. The golden cross made 6.7%, -17.3%, 20.9%, 26.1%, -10.5% and -10.2%. It beat holding in 2022 by 18.4 points and in 2024 by 0.1 points, and trailed in the other four years.
2021 shows the late start. The rule was in cash from January to early October. It bought on 2021-10-19 at $91.88 and made 6.7% for the year, mostly from October, which was 4.82%, and November, which was 1.6%. Holding made 28.5%, so the rule missed most of the year. A crossover between a 50-day and 200-day average needs a long uptrend before the fast line passes the slow one.
2022 is where a golden cross is supposed to help, and it did, in part. The fund fell 35.7% over the year. The rule lost 17.3%. It was in the fund for January, February and early March, and those months cost 9.31%, 3.96% and 5.07%. The death cross came on 2022-03-10, when the rule sold at $80.75 for a loss of 12.11% on the trade, the worst of the five. It then held cash for the rest of the year, through the rebound in July, which was 17.99% for holding, and the lows of the year. Cash avoided a fall that went on to 2022-12-28, and also missed the rebound.
2023 was the reverse. The fund made 38.7% and the rule made 20.9%. The rule did not re-enter until 2023-04-10, bought at $69.69 and sold two days later at $71.31 for 2.32%, then bought again on 2023-05-22 at $73.67. June 2023 made 12% for the rule and November 10.74%, so the second entry caught much of the year, but the 2023 gain still trailed by 17.8 points.
2024 was the best year for the rule at 26.1%, against 26.0% for holding. It was fully invested throughout. 2025 and 2026 were the weak years. In 2025 the rule made -10.5% against 7.3% for holding, and in 2026 it made -10.2% against -7.2%. The 2025 loss came from the February to April decline, when the monthly returns were -6.92%, -8.16% and -7.42%. The rule did not exit until 2025-04-22, after the low on 2025-04-08, which is the lag the strategy's own caveat describes: a cross gives back the first leg of a crash.
Month by month
| Year | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2021 | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 4.8% | 1.6% | 0.2% |
| 2022 | −9.3% | −4.0% | −5.1% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% |
| 2023 | 0.0% | 0.0% | 0.0% | 2.3% | 0.0% | 12.0% | 2.3% | −1.7% | −5.5% | −5.4% | 10.7% | 6.0% |
| 2024 | −4.4% | 7.8% | −0.1% | −4.4% | 0.2% | 3.8% | 2.8% | −0.2% | 7.2% | −1.8% | 12.7% | 1.1% |
| 2025 | 3.4% | −6.9% | −8.2% | −7.4% | 0.0% | 0.0% | 1.2% | 4.6% | 3.5% | 0.1% | −1.4% | 1.1% |
| 2026 | 1.5% | −3.5% | −6.4% | 0.6% | 0.0% | −0.5% | −2.1% | 0.0% | 0.0% | 0.0% | – | – |
Months in cash and months in the fund
The month-by-month table is mostly zeros, and each one is a month in cash. The rule held no position from January to September 2021, from April to December 2022, from January to March 2023 and in May and June of 2025. In the later months of 2026 it was out again after the sale on 2026-07-22. Exposure over the window was 54.6% of days.
The best month was November 2024 at 12.73%, followed by June 2023 at 12%, November 2023 at 10.74% and September 2024 at 7.23%. Holding had its best month in July 2022 at 17.99%, a month the rule sat out. The worst month for the rule was January 2022 at -9.31%, then March 2025 at -8.16% and February 2025 at -6.92%. Holding's worst month was April 2022 at -11.72%, also a month the rule was out of the fund.
This is the pattern of a trend filter: it was absent for some of the best months and absent for some of the worst. The two columns net out unevenly. Sitting out April to December 2022 saved the strategy from the rest of the bear market, and sitting out January to March 2023 cost it the first part of the recovery.
The bigger losses came in months when the rule was in the fund and the fund was falling quickly, which a 200-day average cannot see in advance. January to March 2022 and February to April 2025 together account for the two deepest drawdowns.
Every trade
golden cross on XLY made 5 closed round trips, an average hold of 229 days, an average winner of 8.51%, an average loser of −7.39%, a profit factor of 1.54, a longest losing streak of 1. It held a position at the close on 54.6% of trading days.
| Entry | Entry price | Exit | Exit price | Return | Days held |
|---|---|---|---|---|---|
| 2021-10-19 | $91.88 | 2022-03-10 | $80.75 | −12.1% | 142 |
| 2023-04-10 | $69.69 | 2023-04-12 | $71.31 | 2.3% | 2 |
| 2023-05-22 | $73.67 | 2025-04-22 | $90.19 | 22.4% | 701 |
| 2025-07-08 | $108.30 | 2026-04-01 | $109.14 | 0.8% | 267 |
| 2026-06-17 | $117.56 | 2026-07-22 | $114.43 | −2.7% | 35 |
Prices are adjusted for splits and dividends, so they sit below the quotes printed at the time. An open position is marked at the last close.
The five trades
There are only 5 round trips, so each can be read in full.
- 2021-10-19 to 2022-03-10: bought at $91.88, sold at $80.75, -12.11% over 142 days.
- 2023-04-10 to 2023-04-12: bought at $69.69, sold at $71.31, 2.32% over 2 days.
- 2023-05-22 to 2025-04-22: bought at $73.67, sold at $90.19, 22.42% over 701 days.
- 2025-07-08 to 2026-04-01: bought at $108.30, sold at $109.14, 0.78% over 267 days.
- 2026-06-17 to 2026-07-22: bought at $117.56, sold at $114.43, -2.66% over 35 days.
Prices are adjusted for splits and dividends. The average winner was 8.51% and the average loser was -7.39%, and the average hold was 229.4 days. The median trade made 0.78% and the median hold was 142 days. Two trades produced all of the profit: the 22.42% trade and, far behind it, the 2.32% trade. The other three added up to a loss or a flat result.
The 701-day trade is the one that made the result. It covered the recovery in 2023, the climb through 2024 and the early 2025 decline, and it ended with a sale at $90.19 after the fund had already fallen. Without it the rule would have lost money on this fund. The strategy has 10 fills, so a single trade is a large share of the evidence.
The 2023-04-10 trade lasted 2 days. The rule bought when the 50-day average crossed above the 200-day, sold when it crossed back, and bought again six weeks later. That is a whipsaw, and it made 2.32% by luck of timing. The other short trade, 35 days in June and July 2026, lost 2.66%.
The result for 2026 as a whole was -10.2%, and most of it was not from these trades. The rule held the fund from 2025-07-08 to 2026-04-01 and the fund fell in the first quarter of 2026: February was -3.48% and March was -6.43%. The sale on 2026-04-01 came after the low on 2026-03-30.
Largest drawdowns
| Peak | Low point | Depth | Days to low | Recovered | Days to recover |
|---|---|---|---|---|---|
| 2024-12-17 | 2025-04-08 | −25.6% | 112 | not yet | – |
| 2021-11-19 | 2022-03-07 | −22.1% | 108 | 2024-03-01 | 725 |
| 2024-07-16 | 2024-08-07 | −12.4% | 22 | 2024-09-19 | 43 |
Buy-and-hold's deepest drawdown ran from 2021-11-19 to 2022-12-28 and reached −39.1%.
The drawdowns
The deepest drawdown was 25.65%, from a peak on 2024-12-17 to a low on 2025-04-08, 112 days later. It had not recovered by the end of the test. The date range is nearly the same as buy-and-hold's second drawdown, which was 25.64% over the same dates, and holding recovered from it by 2025-09-12 while the golden cross had not. The rule was fully invested through the decline, sold after the low, and missed the rebound.
The second drawdown was 22.14%, from 2021-11-19 to 2022-03-07, and it took 725 days to recover, to 2024-03-01. The peak date matches the fund's own peak, one month after the rule bought. The third was 12.43% from 2024-07-16 to 2024-08-07, recovered on 2024-09-19, 43 days later.
Buy-and-hold's deepest drawdown was 39.06%, from 2021-11-19 to 2022-12-28, which took 404 days to reach the low and 679 days to recover. The golden cross cut that by selling in March 2022. It stayed shallower than holding by 13.41 points of maximum drawdown. That is the benefit the rule is built for, and it is real in this data. The cost was a CAGR 4.92 points lower and an ending value $3,378 lower.
A trend filter is not a stop. It leaves the position open until the averages cross, and a fast fall does not cross them for weeks. In 2022 the fall that cost 22.14% was in the rule's account for 3 months before the sale.
With trading costs
The headline run fills at the bar price. These runs charge slippage on every fill.
| Slippage per fill | CAGR | Max drawdown | Final value | Sharpe |
|---|---|---|---|---|
| None (headline) | 1.4% | −25.6% | $10,799 | 0.16 |
| 5 basis points | 1.2% | −25.6% | $10,735 | 0.16 |
| 10 basis points | 1.2% | −25.6% | $10,685 | 0.15 |
Costs
The strategy made 10 fills in the window, so costs barely register. At 5 basis points of slippage per fill, the CAGR was 1.24% and the final value $10,735, with a maximum drawdown of 25.56%. At 10 basis points the CAGR was 1.16%, the final value $10,685 and the maximum drawdown 25.61%. The Sharpe ratio moved from 0.16 to 0.157 and then 0.152.
The drop from the headline CAGR to the 10 basis point run is under two tenths of a point. XLY is liquid, with an average daily dollar volume of $892,144,651 and a median minute volume of 15,102 shares, so the modelled costs are reasonable for it. A rule that trades as rarely as this one is not sensitive to cost. The gap to buy-and-hold comes from the timing of the signals.
Changing the parameters
| Version | CAGR | Max drawdown | Round trips | Win rate | Final value |
|---|---|---|---|---|---|
| Published rules | 1.4% | −25.6% | 5 | 60% | $10,799 |
| SMA 40/200 | 4.7% | −25.6% | 5 | 60% | $13,037 |
| SMA 50/150 | 0.2% | −34.5% | 6 | 33% | $10,138 |
| SMA 60/250 | 5.2% | −25.6% | 4 | 50% | $13,356 |
Other moving-average pairs on XLY
Three variants were tested. SMA 40/200, a faster fast line, made 4.73% a year with a 25.59% drawdown, 5 trades and 3 wins, ending at $13,037. SMA 60/250, with both lines slower, made 5.17% with a 25.63% drawdown, 4 trades and 2 wins, ending at $13,356. SMA 50/150, a faster slow line, made 0.24% with a 34.51% drawdown, 6 trades and 2 wins, ending at $10,138.
The published 50/200 pair made 1.35%. Two of the three neighbours did better, by more than three points of CAGR, and the third did worse. The spread between 0.24% and 5.17% for small changes in the line lengths is large next to the 1.35% headline. With 4 to 6 trades, each variant is decided by a small number of crossings, and a change of 10 or 50 days in a line moves a crossing date by weeks. That moves a trade by a few percent and changes which of the 2022 and 2025 declines the rule sat through.
The variant with the shallower drawdown was 40/200 at 25.59%, but all three held the fund through the early 2025 decline and had drawdowns around 25%, except 50/150 at 34.51%. None of them fixed that. The finding is that the drawdown at the 2025 high is common to the whole family of settings, and the differences in CAGR come from the entries in 2021 and 2023.
The results do not point to a better pair. They show that the published result on this fund is one of a spread of outcomes.
How XLY behaved
| Measure | XLY |
|---|---|
| Data in this test | 2021-01-04 to 2026-10-02 (1444 sessions) |
| Total return, buy and hold | 44.7% |
| Annualized volatility | 23.3% |
| Deepest drawdown | −39.7% (2021-11-19 to 2022-12-28) |
| Up days | 53.0% |
| Average daily range | 1.68% |
| Average overnight gap | 0.63% |
| Correlation to SPY | 0.87 |
| Correlation to QQQ | 0.86 |
| Correlation to TLT | 0.11 |
| Sessions above the 200-day average | 65.1% |
| Crossings of the 200-day average | 59 |
| Falls of 10% or more from a 20-day high | 24 |
How XLY behaved and why it matters to a 50/200 cross
XLY made 44.67% over the window with annualized volatility of 23.32%, and a CAGR of 6.64% on the fund's own price series. It closed above its 200-day average on 65.06% of sessions and crossed it 59 times. That is a lot of crossings for a fund that was above the line two thirds of the time, and it is why the 50/200 signal had mixed results. A 50-day and 200-day cross is a slower signal than a 200-day price cross, and the rule made only 5 round trips over the window.
The fund moved with the market. Its correlation to SPY was 0.87 and to QQQ 0.86, with a beta of 1.24 to SPY. Its most correlated funds were VV, SSO, SPY, VOO and SPUU, and its least correlated were the inverse funds SDS, SH, SPDN, PSQ and SQQQ. The fund had 24 falls of 10% or more from a 20-day high, over 98 days. It has a high beta, and a high beta lifts the size of both the declines the rule sat through and the rebounds it missed.
Up days were 53.01% of sessions, the average up day was 1.06% and the average down day was -1.13%. The average intraday range was 1.68% and the average overnight gap was 0.63%. Most of the fund's return came from overnight moves, 89.7%. The biggest single days were 2025-04-09 at 10.79% and 2022-11-10 at 7.27%, and the worst were 2022-05-18 at -6.54% and 2025-04-03 at -5.97%. The 10.79% day on 2025-04-09 came one day after the trough that the golden cross's open position then sat through to its sale on 2025-04-22.
The rebound days show the cost of an exit by crossover. The largest up days sit close to the lows, and a rule that leaves after a decline misses them.
RSI(14) under 30 occurred on 27 sessions, and the median 5-day return afterwards was -0.17%, against a baseline of 0.22%. XLY did not bounce after oversold readings here, which is why the mean-reversion rules did less than on other funds, though still better than the trend rules.
The rules
Hold while the 50-day average is above the 200-day; step aside when it crosses below (the death cross).
- WHEN the market opens · IF not invested AND SMA(50) > SMA(200) · THEN buy with 98% of the sleeve
- WHEN the market opens · IF invested AND SMA(50) < SMA(200) · THEN sell the whole position
A widely used trend filter. When the 50-day simple moving average is above the 200-day, the asset is in a long-term uptrend and the strategy holds. When it crosses below, the strategy moves to cash. It trades rarely, with a handful of signals per decade on an index. Its use is skipping the deepest bear markets, and it will lag some rallies.
Good for: long-horizon investors who want to hold trends but sidestep multi-year bear markets.
Watch out: crosses lag at turning points: the strategy gives back the first leg of a crash and misses the first leg of a recovery, and choppy sideways markets whipsaw it.
How the rules compare with the other templates
On XLY the trend rules were at the bottom of the ranking. Weekly 7% target made 10.19% with a 24.73% drawdown, RSI(2) snapback made 8.2% with 16.62%, and RSI mean reversion made 7% with 20.65%. Dip buyer made 4.01% and momentum breakout made 3.83%. Monthly cycle made 3.67% with a 43.81% drawdown. Among trend rules, EMA 12/26 made 2.36%, the golden cross made 1.35%, SMA 10/50 made 0.35%, the 200-day filter lost 2.16%, 3-month momentum lost 3.94% and trend + trailing stop lost 4.4%.
The golden cross made 5 round trips, so it traded less than the faster trend rules. None of the trend rules beat buy-and-hold at 6.27%. Seven templates did better than the golden cross in CAGR, including the three mean-reversion rules, which suits a cyclical fund that dipped hard and recovered several times.
Among the sector funds, the golden cross made 28.24% on SOXX, 15.33% on XLK, 11.2% on VOX, 3.6% on XLF, 2.05% on XLP and 1.35% on XLY. The rule did well on funds that had long uninterrupted climbs and poorly on a fund with two sharp falls in a short window.
The test stops at one fund, one window of 5.74 years and 5 trades. It says that this rule on this fund gave up return in exchange for a shallower worst drawdown, and that the 2025 decline went through it. It does not say how the rule performs across a full market cycle. The results are hypothetical and are not advice.
Build it from blocks (or type it in English), backtest it on 5.7 years of minute data in seconds, tweak any parameter, then paper trade it on live data. No card, no broker needed to start.
Frequently asked questions
Did golden cross beat buy-and-hold on XLY?
Over 2021-01-04 to 2026-10-02, golden cross on XLY returned 1.4% annualized vs 6.3% for buy-and-hold: it trailed buy-and-hold by 4.9% per year, with a maximum drawdown 13.4 points shallower than holding (25.6% vs 39.1%).
How many trades did it make?
5 completed round trips over 5.7 years (10 fills), with 60% of round trips closing profitably.
How often does a golden cross happen?
On a broad index, roughly every couple of years. The backtest pages show the exact trade count for each ETF over the 2021 to 2026 window.
Golden cross vs buy and hold: which does better?
It depends on the asset and the window. Every backtest page here shows the same-window buy-and-hold comparison.
Did the golden cross beat buy-and-hold on XLY?
No. From 2021-01-04 to 2026-10-02 the golden cross made 1.35% a year and ended at $10,799, while buy-and-hold made 6.27% and ended at $14,177. The rule beat holding in 2022 and 2024 and trailed in the other four years.
How many trades did it make on XLY?
Five round trips and 10 fills, with 3 winners, a 60% win rate and a profit factor of 1.54. The average hold was 229.4 days and the longest was 701 days, a trade from 2023-05-22 that made 22.42%.
Did the golden cross avoid the 2022 decline?
In part. It bought on 2021-10-19, fell with the fund through early 2022 and sold on 2022-03-10 at a 12.11% loss. It then held cash for the rest of the year. The rule lost 17.3% in 2022 against 35.7% for holding.
What was the maximum drawdown?
25.65%, from 2024-12-17 to 2025-04-08, and it had not recovered by the end of the test. Buy-and-hold fell 39.06% from 2021-11-19 to 2022-12-28. The rule sold on 2025-04-22, after the April low.
Do other moving-average lengths work better on XLY?
Two of three did. SMA 60/250 made 5.17% and SMA 40/200 made 4.73%, while SMA 50/150 made 0.24%. With 4 to 6 trades each, the differences come from a handful of crossing dates.
How much do trading costs matter for the golden cross on XLY?
Very little. At 5 basis points per fill the CAGR was 1.24%, and at 10 basis points it was 1.16%, against 1.35% in the headline run. The strategy made only 10 fills.
Related
Backtests are hypothetical, computed by DeployQuant's engine on minute-resolution consolidated US market data (2021-01-04 to 2026-10-02, $10,000 starting capital, no margin, no fees or slippage in the headline run; buy-and-hold puts 98% of the account in at the first open, as the templates do) and do not guarantee future results. Nothing on this page is investment advice. Live trading involves risk of loss.