Learn › Strategies › Golden Cross (SMA 50/200) › XLP

Golden Cross (SMA 50/200) on XLP

Consumer Staples Select Sector SPDR Fund: defensive consumer staples, a common risk-off equity sector. Backtest 2021-01-04 to 2026-10-02, $10,000 starting capital, computed by the same engine that runs live DeployQuant strategies.

Result: golden cross on XLP turned $10,000 into $11,236 (12.4% total, 2.0% CAGR): it trailed buy-and-hold by 3.8% per year, with a maximum drawdown 1.7 points shallower than holding (14.3% vs 16.0%).

The golden cross rule owns a fund while its 50-day simple average is above its 200-day average and sells when the 50-day drops below the 200-day. On XLP, the Consumer Staples Select Sector SPDR Fund, it turned $10,000 into $11,236 between 2021-01-04 and 2026-10-02. That is a total return of 12.36% and a CAGR of 2.05%.

Holding XLP over the same dates turned $10,000 into $13,819, a CAGR of 5.8%. The rule gave up 3.75 CAGR points to holding, and its maximum drawdown was 14.3% against 15.99% for holding. It had a Sharpe ratio of 0.24 against 0.51. It beat buy-and-hold in one calendar year of six, 2025.

The rule is slow. It made 3 round trips in nearly six years and was invested 67% of the time. Two of the three won and one lost, and the average hold was 388.7 days. A fourth position was still open at the end of the window. With so few trades, and each one shapes the result.

2.0%CAGR
5.8%buy & hold CAGR
−14.3%max drawdown
0.24Sharpe ratio
3round trips
67%win rate
■ golden cross   ■ buy & hold, $10,000 invested 2021-01-04

Year by year

Yeargolden crossbuy & hold
202110.3%18.1%
2022−4.1%−0.7%
2023−3.6%−0.9%
20249.5%12.0%
20253.2%1.5%
2026−2.5%5.6%

Year by year against holding XLP

The strategy returned 10.3% in 2021, -4.1% in 2022, -3.6% in 2023, 9.5% in 2024, 3.2% in 2025 and -2.5% in the partial 2026 year. Holding returned 18.1%, -0.7%, -0.9%, 12%, 1.5% and 5.6%.

The rule trailed by 7.8 points in 2021. The golden cross needs a 200-day average, so the rule could not buy until enough history existed, and its first entry came on 2021-10-19. The rule missed the part of the year before that date, and its 10.3% came from the last stretch.

In 2022 and 2023 the fund was flat, with holding at -0.7% and -0.9%. The rule was down more, at -4.1% and -3.6%, and trailed by 3.4 and 2.7 points. The reason is in the trades below: it bought in October 2021, sold in July 2022 at a gain, then bought back in December 2022 and sold in September 2023 at a loss. Those two years of sideways price action are the choppy conditions the template's caveat describes.

2024 was a trailing year too, 9.5% against 12%, because the rule did not buy until 2024-02-06. 2025 was the single year it won, 3.2% against 1.5%. The position was open through most of 2025 and was sold on 2025-10-23, before the fund's low on 2025-11-06 in its 8.37% decline from 2025-08-20. In 2026 the rule trailed by 8.1 points, since it was out of the fund in January and bought on 2026-02-03.

Month by month

YearJanFebMarAprMayJunJulAugSepOctNovDec
20210.0%0.0%0.0%0.0%0.0%0.0%0.0%0.0%0.0%1.4%−1.4%10.3%
2022−1.4%−1.3%1.5%2.5%−4.0%−2.3%1.1%0.0%0.0%0.0%0.0%0.0%
2023−1.1%−2.3%4.1%3.6%−6.0%2.7%2.0%−3.9%−2.4%0.0%0.0%0.0%
20240.0%1.0%3.3%−1.0%2.3%−0.2%1.6%5.9%1.2%−3.5%3.8%−4.7%
20250.5%5.0%−1.1%0.2%1.2%−1.6%−1.4%1.3%−2.3%1.6%0.0%0.0%
20260.0%6.7%−8.2%2.8%−1.6%0.9%2.3%−0.1%−4.4%−0.1%––

The months that mattered

The best month was December 2021 at +10.34%. Holding made +10.36% in the same month, so the rule caught almost all of it. The next best months were February 2026 at +6.66%, August 2024 at +5.86% and February 2025 at +5%.

The worst month was March 2026 at -8.23%, against -8.31% for holding. That is the same loss as holding, because the rule held a position all through that month. Other bad months were May 2023 at -6.01%, December 2024 at -4.73% and September 2026 at -4.44%.

The fund's own average returns by calendar month fit that pattern. September averaged -3.79% across the six Septembers in the data, and November averaged +3.33%. These are averages of five or six observations each, so they are anecdotes about this window.

In months when the rule is in the fund, its monthly return matches the fund's within a fraction of a point. The difference comes from the months when it is out, and those months are where the rule gave up return. A rule that holds for 388.7 days at a time shows the same monthly numbers as the fund while it is in, and zero while it is out.

Every trade

golden cross on XLP made 3 closed round trips and one position still open at the end of the test, an average hold of 389 days, an average winner of 9.59%, an average loser of −3.69%, a profit factor of 5.00, a longest losing streak of 1. It held a position at the close on 67.0% of trading days.

EntryEntry priceExitExit priceReturnDays held
2021-10-19$61.522022-07-12$65.155.9%266
2022-12-21$67.472023-09-22$64.98−3.7%275
2024-02-06$68.442025-10-23$77.5313.3%625
2026-02-03$82.66open–−2.5%–

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.

All four trades

The first trade bought on 2021-10-19 at an adjusted price of 61.52 and sold on 2022-07-12 at 65.15, a gain of 5.9% over 266 days. It entered in October 2021, held through the April 2022 peak and the decline after it, and exited above its entry price.

The second bought on 2022-12-21 at 67.47 and sold on 2023-09-22 at 64.98, a loss of 3.69% over 275 days. This was the one losing trade and the worst of the four. The adjusted price had gone sideways, and the death cross arrived after the fund had drifted below the entry.

The third was the one that made the result. It bought on 2024-02-06 at 68.44 and sold on 2025-10-23 at 77.53, a gain of 13.28% over 625 days, the longest hold. That single trade is the reason the profit factor is 5. The other two closed trades were +5.9% and -3.69%.

The fourth bought on 2026-02-03 at 82.66 and was still open at the end of the window with an unrealized return of -2.55%. It is not counted in the 3 round trips or the 67% win rate. The average win was 9.59% and the average loss was -3.69%. The median trade returned 5.9% and lasted 275 days, and the shortest hold was 266 days.

Four decisions in nearly six years is a small sample. One more trade in either direction would shift the CAGR by a point or more.

Largest drawdowns

PeakLow pointDepthDays to lowRecoveredDays to recover
2022-04-202022-06-17−14.3%582024-08-27802
2026-02-272026-03-20−9.4%21not yet–
2024-09-162025-01-15−8.2%1212025-02-2541

Buy-and-hold's deepest drawdown ran from 2022-04-20 to 2022-10-07 and reached −16.0%.

Drawdowns

The maximum drawdown was 14.3%, from a peak on 2022-04-20 to a trough on 2022-06-17, 58 days. Recovery took until 2024-08-27, 802 days after the peak. Buy-and-hold had the same peak date. Its decline ran to 2022-10-07 for 15.99% and recovered on 2024-03-28.

The strategy's trough came earlier because it sold on 2022-07-12, ahead of the fund's October low. Its drawdown was shallower by 1.69 points, a small benefit. The account still took 802 days to regain its peak, longer than holding did.

The second drawdown was 9.43%, from 2026-02-27 to 2026-03-20, still unrecovered at the end of the data. The third was 8.18%, from 2024-09-16 to 2025-01-15, which recovered in 41 days on 2025-02-25. Holding XLP had drawdowns of 9.52% and 8.37% in the same periods.

The pattern is that this rule does not avoid the fund's drawdowns. XLP is a low-volatility fund, with an annualized volatility of 13.28%, so the drawdowns are mild to begin with. The rule shaved the largest by a little and left the others as they were.

With trading costs

The headline run fills at the bar price. These runs charge slippage on every fill.

Slippage per fillCAGRMax drawdownFinal valueSharpe
None (headline)2.0%−14.3%$11,2360.24
5 basis points2.0%−14.3%$11,1910.23
10 basis points1.9%−14.3%$11,1570.23

What costs did

The headline run has no fees or slippage. At 5 basis points per trade the CAGR was 1.98% and the ending equity was $11,191. At 10 basis points it was 1.92% and $11,157. The maximum drawdown was 14.3% in both runs.

Seven fills over the window means costs have little to charge. The rule's gap to holding comes from timing, not from trading frictions. XLP is also liquid: its average daily dollar volume was $854,044,173 and its median minute volume was 17,592 shares, so the minute-bar fill assumption sits comfortably inside what the fund trades.

Changing the parameters

VersionCAGRMax drawdownRound tripsWin rateFinal value
Published rules2.0%−14.3%367%$11,236
SMA 40/2000.2%−19.8%540%$10,140
SMA 50/1501.5%−14.6%450%$10,897
SMA 60/250−3.1%−23.2%425%$8,357

What other averages did

We reran the rule with three other pairs on XLP.

The default 50/200 pair at 2.05% beat all three. The nearest, 50/150, was close at 1.51% with a similar drawdown. The variant that changed only the fast average, 40/200, did worse with a deeper drawdown, and the slowest pair, 60/250, lost money.

The 50/200 result does not make it the right setting for XLP. With 4 or 5 trades, the difference between pairs is the difference of one or two trades timed slightly earlier or later. The 60/250 variant entered later and exited later, and 1 of its 4 trades won. These runs show how sensitive the result is to the choice of pair. They do not select one.

How XLP behaved

MeasureXLP
Data in this test2021-01-04 to 2026-10-02 (1444 sessions)
Total return, buy and hold40.3%
Annualized volatility13.3%
Deepest drawdown−16.3% (2022-04-20 to 2022-10-07)
Up days51.6%
Average daily range1.12%
Average overnight gap0.29%
Correlation to SPY0.47
Correlation to QQQ0.30
Correlation to TLT0.13
Sessions above the 200-day average75.1%
Crossings of the 200-day average73
Falls of 10% or more from a 20-day high1

How XLP behaved

XLP holds large consumer staples companies, and the data labels it a defensive sector often used as a risk-off equity sector. It returned 40.33% over the window, a CAGR of 6.08%, with a maximum drawdown of 16.27% from 2022-04-20 to 2022-10-07. The longest drawdown ran 486 sessions.

Its annual returns were 18.47% in 2021, -0.75% in 2022, -0.89% in 2023, 12.23% in 2024, 1.53% in 2025 and 5.68% in the partial 2026 year. Two flat years sit between two good ones. A trend rule makes money from sustained moves, and XLP's gains came in two blocks with a flat stretch between them.

It moves slowly. The average intraday range was 1.12%, the average overnight gap was 0.29% and the average up and down days were 0.64% and -0.63%. About 72.64% of its log return came intraday and 27.36% overnight. It rose on 51.63% of days.

Its beta to SPY was 0.38 and its correlation to SPY was 0.47. Against QQQ the correlation was 0.3 and against TLT 0.13. The most similar funds were VTV at 0.64 and VOOV at 0.63, both value funds. The least similar were SDS, SH and SPDN at -0.47 each, then VIXM at -0.33 and UVXY at -0.32.

The price was above its 200-day average on 75.1% of sessions but crossed the average 73 times. That count matters for a 50/200 rule. The price crosses its 200-day average often, but the 50-day average crosses the 200-day average rarely, which is why the golden cross made only 3 round trips where a price-versus-average rule would trade much more.

The RSI(14) was below 30 on 37 sessions. The median 20-day return after those sessions was 2.44% against a baseline of 0.73%, a sign that washouts in XLP were followed by bounces in this window. The fund also had just 1 event of a 10% drop inside 20 sessions, covering 3 sessions. It rarely produces the sharp dips that some other strategies need.

Calendar quirks and the largest single days in XLP

The five worst sessions in the data tell a different story from the drawdown table. The fund's single worst day was 2022-05-18 at -6.45%, followed by 2025-04-04 at -4.24%, 2022-09-13 at -3.38%, 2022-03-08 at -2.75% and 2023-01-18 at -2.72%. Three of the five fell inside 2022, the year the strategy's first position was still open. The best session was 2025-04-09 at +3.81%, then 2022-02-25 at +3.19% and 2026-07-16 at +2.8%.

The 2022-05-18 drop is the one that stands out for a trend rule. It happened while the 50-day average was still above the 200-day, so the golden cross held through it and sold only on 2022-07-12. A rule that waits for two averages to cross cannot react to a single gap of that size, and the page's year table shows the cost: the strategy's -4.1% in 2022 against -0.7% for the fund.

By weekday the fund was close to flat. Friday averaged +0.13%, Monday +0.06%, Thursday +0.01%, Tuesday -0.02% and Wednesday -0.04%. None of those separates from noise over 1,444 sessions, and the rule does not use the weekday anyway. The lag-1 autocorrelation of daily returns was -0.01, so one day's move told nothing about the next.

The month-of-year averages for the fund show more spread. April averaged +1.68%, February +1.67%, July +1.67%, January +1.33% and March +1.32%. May averaged -1.08% and June -0.17%. Each month has only five or six observations, so these are descriptions of this window. The rule only enters and exits on average crossings, so the calendar did not drive any of its four trades.

The rules

Hold while the 50-day average is above the 200-day; step aside when it crosses below (the death cross).

  1. WHEN the market opens · IF not invested AND SMA(50) > SMA(200) · THEN buy with 98% of the sleeve
  2. 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 golden cross fits a low-volatility fund

The golden cross is built for sustained trends and tolerates slow turning points. On XLP, a fund with 13.28% volatility, the 50-day average rarely moves far from the 200-day average, so crosses are rare and a position held through a cross can be a few percent from breakeven. That produces the 266, 275 and 625 day holds in the trade list.

The other strategies on XLP show how much that patience cost. The RSI(2) snapback returned 8.22% with an 11.06% drawdown. RSI mean reversion returned 6.51% with a 9.64% drawdown. The monthly cycle returned 5.46% and the weekly 7% target returned 2.37%. The golden cross at 2.05% ranked 5th of 12.

Behind it were the trend plus trailing stop at 1.82%, the dip buyer at 1.32%, the SMA 10/50 trend at 1.21% and the EMA 12/26 trend at 1.19%. The 200-day regime filter lost 0.81%, the 3-month momentum rule lost 1.67% and the momentum breakout lost 1.87%. Trend rules clustered at the bottom of the table, and short-horizon rules led it.

Within the sector funds, the rule's CAGR on SOXX was 28.24%, on XLK 15.33% and on VOX 11.2%. XLF returned 3.6% and XLY 1.35%. XLP at 2.05% ranked 30th of 59 funds for this rule, and the median across all 59 was 2.05%. The median across sector funds was 11.2%, so staples sat below the group.

A trend rule needs a trend. XLP's two strong years, 2021 and 2024, were the ones where the rule made most of its money, and the flat years in between produced a loss and a small gain.

Why the short-term RSI rules led on this fund

The fund spent 156 sessions with RSI(2) under 10. The median 5-day return after those sessions was 0.26% against a baseline of 0.18%, and the median 20-day return was 1.09% against 0.73%. The edge is small, but it was positive at both horizons, and it repeated 154 and 150 times in the samples. A rule that buys those dips and sells the bounce collects that small edge many times, which is how the RSI(2) snapback reached an 8.22% CAGR.

RSI(14) went above 70 on 73 sessions and below 30 on 37. The oversold count is smaller than the overbought count, so XLP spent more time stretched upward than washed out. After the 37 oversold sessions the median 5-day return was 0.59% against the same 0.18% baseline.

The golden cross uses none of this. It waits for a slow signal on a fund that moves 0.64% on an average up day, and the signal arrived four times. The fund crossed its 200-day line 73 times, so the choice of averages decides which of those 73 moves the rule ever sees. The 50/200 pair filtered almost all of them out and kept three closed trades, with the 2024 to 2025 position doing the work.

What being out of the fund cost

Exposure was 67%, so the account sat in cash for the other third of the days. The ending equity gap to holding was $2,583, the distance between $11,236 and $13,819. The rule bought late, in October 2021, and bought again on 2024-02-06 for its third trade. Those entries are the cost of waiting for a 50-day average to rise above a 200-day average.

The benefit of waiting is that the rule avoids an extended downtrend. The fund did not have one in this window. Its worst drawdown was 16.27%, and it recovered on 2024-03-28. A rule built to avoid a 50% crash has little to do in a fund that never had one, so the cost is visible in the numbers and the benefit is not.

A reader comparing this page with a golden cross on a more volatile fund would see the opposite balance, where the same rule trades more and its drawdown protection matters more. That comparison is available on the pages for XLK and SOXX, which sit in the same category with returns of 15.33% and 28.24%.

What the test does not cover

The window is 5.74 years, and the 200-day average needs 200 sessions of history, so the first entry came on 2021-10-19. The result rests on 3 closed trades and 1 open trade. A different start date would move the entries and could change the sign of the result.

The headline run has no fees or slippage, and the cost runs were close to it. The prices in the trade list are adjusted for splits and dividends. The rule decides once a day and fills on the next minute bar. Results are hypothetical, and they describe past data only.

Run golden cross on XLP yourself, free →

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 XLP?

Over 2021-01-04 to 2026-10-02, golden cross on XLP returned 2.0% annualized vs 5.8% for buy-and-hold: it trailed buy-and-hold by 3.8% per year, with a maximum drawdown 1.7 points shallower than holding (14.3% vs 16.0%).

How many trades did it make?

3 completed round trips over 5.7 years (7 fills), with 67% 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.

How did the golden cross do on XLP?

It turned $10,000 into $11,236 from 2021-01-04 to 2026-10-02, a CAGR of 2.05% with a maximum drawdown of 14.3%. It made 3 round trips and won 2. Buy-and-hold returned 5.8% a year.

Did the golden cross beat buy-and-hold on XLP?

No. It trailed by 3.75 CAGR points and beat holding in one year only, 2025. Its drawdown was shallower, 14.3% against 15.99%, and its Sharpe ratio was 0.24 against 0.51.

Why were there so few trades?

The 50-day average crosses the 200-day average rarely, and XLP is a low-volatility fund with 13.28% annualized volatility. The rule held for 266, 275 and 625 days in its three closed trades, with a fourth position open at the end.

Which trade made the most money?

The one from 2024-02-06 to 2025-10-23. It bought at 68.44 and sold at 77.53, a gain of 13.28% over 625 days. It is the reason the profit factor is 5.

Did a different moving-average pair help?

Not on XLP. SMA 40/200 returned 0.24%, 50/150 returned 1.51% and 60/250 lost 3.08%, against 2.05% for 50/200. With 4 or 5 trades each, the gaps reflect timing of one or two trades.

How does the golden cross rank against other strategies on XLP?

It ranked 5th of 12 at 2.05%. The RSI(2) snapback led at 8.22% and RSI mean reversion followed at 6.51%. The momentum breakout was last at -1.87%.

Is this a prediction for XLP?

No. These are hypothetical backtests on one 5.74-year window, with no fees or slippage in the headline run. They describe what the rule did on past data.

Related

Golden Cross (SMA 50/200) on all 59 ETFsfull results table All strategies on XLP12 templates compared RSI(14) Mean Reversion on XLPsame ETF, different rulesRSI(2) Dip Snapback on XLPsame ETF, different rules

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.