XLY trading strategies, backtested
Consumer Discretionary Select Sector SPDR Fund: consumer discretionary stocks, a cyclical read on the US consumer. Every DeployQuant template run on XLY over 5.7 years of minute data, same engine, same window, sorted by return.
XLY is the Consumer Discretionary Select Sector SPDR Fund, a fund of US consumer cyclical stocks. It is the weakest of the sector funds in this study on buy-and-hold: from 2021-01-04 to 2026-10-02 it returned a CAGR of 6.27% in the strategy engine, turning $10,000 into $14,177, with a max drawdown of 39.06% and a Sharpe ratio of 0.39. Its annualized volatility was 23.32%.
Twelve rule sets were run on it. Three finished ahead of buy-and-hold on CAGR: the weekly 7% target at 10.19%, the RSI(2) snapback at 8.2% and the RSI(14) mean reversion at 7.0%. Ten had a shallower drawdown than holding, and nine ended with a positive CAGR. Three ended negative: the 200-day regime filter, the 3-month momentum switch and the trend plus trailing stop.
XLY differs from the broad index funds in one way that matters for these rules. It fell 36.28% in calendar 2022, rose 39.68% in 2023, and is down 7.26% in the part of 2026 covered by the window. Big swings in both directions punish rules that act late and reward rules that sit out a fall and buy the rebound. The headline runs carry no fees or slippage, and the cost runs show that for this fund the cost of trading matters more than usual.
| Strategy | CAGR | max DD | Sharpe | trades | win rate | final value |
|---|---|---|---|---|---|---|
| Weekly Entry + 7% Target | 10.2% | −24.7% | 0.59 | 130 | 29% | $17,458 |
| RSI(2) Dip Snapback | 8.2% | −16.6% | 0.58 | 154 | 64% (+1 open) | $15,726 |
| RSI(14) Mean Reversion | 7.0% | −20.6% | 0.49 | 15 | 73% (+1 open) | $14,747 |
| Drawdown Dip Buyer + 8% Target | 4.0% | −32.7% | 0.30 | 3 | 100% | $12,534 |
| 20-Day Momentum + Trailing Stop | 3.8% | −18.4% | 0.33 | 9 | 56% | $12,406 |
| First-to-Last Day of Month | 3.7% | −43.8% | 0.28 | 69 | 52% (+1 open) | $12,300 |
| EMA 12/26 Trend | 2.4% | −21.3% | 0.23 | 28 | 36% | $11,434 |
| Golden Cross (SMA 50/200) | 1.4% | −25.6% | 0.16 | 5 | 60% | $10,799 |
| SMA 10/50 Trend | 0.3% | −27.5% | 0.10 | 22 | 41% | $10,202 |
| 200-Day SMA Regime Filter | −2.2% | −27.3% | -0.09 | 30 | 23% | $8,821 |
| 3-Month Momentum Switch | −3.9% | −34.6% | -0.24 | 17 | 35% | $7,941 |
| SMA-200 Trend + 15% Trailing Stop | −4.4% | −39.7% | -0.19 | 7 | 43% (+1 open) | $7,721 |
| Buy & hold XLY | 6.3% | −39.1% | 0.39 | – | – | $14,177 |
Which rules held up on XLY and which did not
The weekly 7% target led. It made 130 round trips, won 29% of them, and still ended at a CAGR of 10.19% because the average win of 7.05% outweighed the average loss of 2.16%. Its profit factor was 1.28, which is thin for 130 trades. The strategy was invested 80.5% of the time. It beat holding by 22.4 points in 2022, 8.1 in 2023 and 6.7 in 2025, and trailed it by 9.2 in 2021, 9.7 in 2024 and 4.9 in 2026. Its 2023 return was 46.8%, the best single calendar year of any rule in this set. The max drawdown of 24.73% ran from 2022-01-03 to 2022-05-24 and recovered by 2022-08-12.
The RSI(2) snapback finished second at 8.2% with a drawdown of 16.62%. It made 154 round trips with a 64% win rate, an average hold of 5.5 days and exposure of 40.4%. It lost 13.7% in 2022 against 35.7% for holding, and it was ahead of holding in 2026 by 10.9 points. Its average loss of 1.95% was larger than its average win of 1.64%, so the 64% hit rate carried a profit factor of only 1.43. The RSI mean reversion came third at 7.0% on 15 round trips with a 73% win rate and a 20.65% drawdown.
The trend rules did poorly. The EMA 12/26 returned 2.36% and won 36% of 28 trades. The SMA 10/50 returned 0.35% and the golden cross returned 1.35%. The 200-day regime filter lost 2.16% a year with a 23% win rate and a profit factor of 0.7, and it made 13 round trips in the 2026 stretch alone. A fund that crossed its 200-day average 59 times in the window is a poor candidate for a rule that follows the average.
The monthly cycle returned 3.67% with a 43.81% drawdown, deeper than holding. The trend plus trailing stop lost 4.4% a year with a 39.69% drawdown, and the 3-month momentum lost 3.94% a year with a 34.61% drawdown. The momentum breakout returned 3.83% on 9 round trips. The trailing-stop templates are backtest-only for now, so those two rows describe simulated history.
The dip buyer made 3 round trips, won all three at about 8%, and still returned only 4.01% because it held through the 2022 fall: its drawdown was 32.73%, and one of its holds lasted 971 days.
How each strategy traded XLY
| Strategy | Time in market | Avg hold (days) | Best trade | Worst trade | Profit factor | With 10 bps slippage |
|---|---|---|---|---|---|---|
| weekly 7% target | 80.5% | 12 | 7.7% | −6.8% | 1.28 | 2.7% |
| RSI(2) snapback | 40.4% | 6 | 8.5% | −13.5% | 1.43 | 2.7% |
| RSI mean reversion | 38.6% | 53 | 9.4% | −8.0% | 2.98 | 6.4% |
| dip buyer | 53.2% | 373 | 8.0% | 8.0% | – | 4.0% |
| momentum breakout | 60.7% | 142 | 15.2% | −9.6% | 1.88 | 3.5% |
| monthly cycle | 95.2% | 28 | 15.8% | −14.1% | 1.15 | 1.3% |
| EMA 12/26 trend | 59.3% | 44 | 16.9% | −5.8% | 1.26 | 1.4% |
| golden cross | 54.6% | 229 | 22.4% | −12.1% | 1.54 | 1.2% |
| SMA 10/50 trend | 57.9% | 55 | 21.5% | −11.0% | 1.04 | −0.5% |
| 200-day regime filter | 56.1% | 39 | 11.6% | −5.7% | 0.70 | −3.1% |
| 3-month momentum | 49.3% | 61 | 13.4% | −11.5% | 0.53 | −4.5% |
| trend + trailing stop | 67.6% | 178 | 28.8% | −14.6% | 0.54 | −4.7% |
The trades behind the numbers
Trade counts show how differently the rules spend their time. The two RSI(2) and weekly rules traded 154 and 130 times with holds of 5.5 and 11.9 days. The trend rules traded 22 to 30 times with holds of 39 to 229 days. The dip buyer, golden cross and trend plus trailing stop traded between 3 and 7 times.
The worst single trade in the RSI(2) snapback was a loss of 13.49% from 2025-02-19 to 2025-03-18, a 27-day hold that was far longer than its typical 5.5 days. A second loss of 10.36% ran from 2022-06-09 to 2022-06-16. Both came when the fund kept falling after the oversold signal. The best trade was 8.5% from 2025-04-07 to 2025-04-10, which spans the best day in the sample on 2025-04-09 when XLY rose 10.79%. One trade out of 155 produced a gain that size, and without it the CAGR would look different.
The weekly target's trades are small by construction. Its best was 7.66% from 2026-03-30 to 2026-04-14 and its worst was 6.82% negative from 2022-05-09 to 2022-05-12. The median trade was a loss of 0.9% with a median hold of 3 days. The rule lost more often than it won, and the 7% winners paid for it. In 2026 it won only 2 of 20 round trips, and its 2026 return was 12.1% negative.
The golden cross had one very good trade, a 22.42% gain from 2023-05-22 to 2025-04-22, and one bad one, a 12.11% loss from 2021-10-19 to 2022-03-10. The 2021-10-19 entry also appears in the trend plus trailing stop and other long-horizon rules. Each bought about a month before the fund's 2021-11-19 peak and took the 2022 decline in full or in part.
The SMA 10/50 and the EMA 12/26 each produced a few trades worth 15% to 21%, the SMA 10/50 gaining 21.47% from 2024-08-27 to 2025-02-13 and the EMA 12/26 gaining 16.91% over 2024-08-22 to 2025-01-13. Their median trades were losses of 0.74% and 1.75%. Each rule gave back much of its edge in a long string of small losses in 2022 and 2026: the EMA 12/26 won none of its 6 trades in 2026, and the SMA 10/50 won none of its 4 trades in 2022.
The RSI mean reversion won all 4 trades in 2023 and both trades in 2024 and 2026. Its worst loss was 8.01% from 2025-02-24 to 2025-05-08, and none of its 3 trades in 2022 won. The year-by-year record is clean on the way up and poor in a decline.
Cost, not the signal, decided the weekly rule
The weekly 7% target is the clearest case where the cost run changes the story. At 5 basis points its CAGR fell from 10.19% to 4.71%, and at 10 basis points it fell to 2.74%. The max drawdown rose to 29.24% and 30.81%. With 130 round trips, each fill pays the spread, and the average win of 7.05% leaves only a thin margin over the average loss of 2.16% once a few basis points are subtracted on every fill.
The RSI(2) snapback is also sensitive. Its CAGR was 5.38% at 5 basis points and 2.67% at 10, from 8.2% in the headline run. At either cost level both fast rules finished below the 6.27% for buy-and-hold.
The slow rules barely move. The RSI mean reversion went from 7.0% to 6.74% and 6.44%. The momentum breakout went from 3.83% to 3.69% and 3.5%. The dip buyer was unchanged at 4.01% and 4.02%. Holding costs a single fill, so rules with few trades pass through costs almost untouched.
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 |
Calendar years
| Year | Return |
|---|---|
| 2021 | 29.1% |
| 2022 | −36.3% |
| 2023 | 39.7% |
| 2024 | 26.5% |
| 2025 | 7.4% |
| 2026 (part) | −7.3% |
Biggest single days
| Best day | Move |
|---|---|
| 2025-04-09 | 10.8% |
| 2022-11-10 | 7.3% |
| 2025-05-12 | 5.1% |
| 2022-05-26 | 4.9% |
| 2022-10-17 | 4.1% |
| Worst day | Move |
|---|---|
| 2022-05-18 | −6.5% |
| 2025-04-03 | −6.0% |
| 2022-05-05 | −5.5% |
| 2022-09-13 | −5.1% |
| 2022-04-26 | −5.1% |
Average return by calendar month
| Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1.2% | −1.6% | −0.5% | −0.5% | 0.8% | 1.3% | 4.2% | 0.1% | −1.9% | 1.2% | 5.1% | −0.6% |
Most and least correlated funds
| Most correlated | Least correlated | ||
|---|---|---|---|
| VV | 0.88 | SDS | -0.87 |
| SSO | 0.87 | SH | -0.87 |
| SPY | 0.87 | SPDN | -0.87 |
| VOO | 0.87 | PSQ | -0.86 |
| SPUU | 0.87 | SQQQ | -0.86 |
What XLY did day by day
XLY rose on 53.01% of sessions. The average up day was 1.06% and the average down day was 1.13% negative, so the average loss on a down day was larger than the average gain on an up day. The average intraday range was 1.68%. Lag-1 autocorrelation was 0.02 negative, close to zero.
The fund's peak was 2021-11-19, its trough was 2022-12-28, and it did not recover until 2024-11-06. The price drawdown was 39.67%, and the longest underwater stretch lasted 743 sessions. Calendar-year returns were 29.05% in 2021, 36.28% negative in 2022, 39.68% in 2023, 26.51% in 2024 and 7.36% in 2025. The monthly view shows November as the strongest average month at 5.12% across 5 observations, followed by July at 4.24%. September averaged 1.9% negative and February 1.56% negative. Each of those averages rests on 5 or 6 observations, so they describe this window and not a seasonal rule.
The best day was 2025-04-09 at 10.79%, and the next best was 2022-11-10 at 7.27%. The worst day was 2022-05-18 at 6.54% negative, followed by 2025-04-03 at 5.97% negative and 2022-05-05 at 5.49% negative. A fund with an annualized volatility of 23.32% produces days like these often. In the window there were 24 separate drawdown events of 10% within 20 days, covering 98 trading days.
Overnight gaps matter here. The average overnight gap was 0.63%, and the overnight log return was 31.78% against 3.65% for the intraday portion, an overnight share of 89.7%. Almost all of XLY's return in this window arrived between the close and the next open. A rule that buys at the open and exits at a limit during the day collects the intraday part only when it is invested at the close. The weekly 7% target, with exposure of 80.5%, held through most gaps. The RSI(2) snapback, at 40.4%, held through fewer.
The RSI statistics explain the ordering of the mean-reversion rules. RSI(14) fell below 30 on 27 sessions, and the median forward 5-day return after those was 0.17% negative, with a median 20-day return of 0.78% negative, both below the baseline medians of 0.22% and 0.77%. A deep oversold reading on this fund was not followed by a bounce in the median case. RSI(2) below 10 occurred on 152 sessions, with a median forward 5-day return of 0.74% and a 20-day median of 1.8%, above the baselines. That fits the data on the short-horizon rule: it worked on the fast dips and the slow RSI(14) rule worked only through a few large winners such as 9.43% from 2024-08-06 to 2024-08-26.
The fund was above its 200-day average on 65.06% of sessions and crossed it 59 times. XLY has a beta of 1.24 to SPY and a correlation of 0.87, and 0.86 to QQQ. Among the sector peers, SOXX had a buy-and-hold CAGR of 31.11%, XLK 22.07%, XLF 12.58%, VOX 9.08% and XLP 5.8%. XLY's 6.27% is near the bottom of that group.
The fund's closest relatives by correlation are VV at 0.88, then SSO, SPY, VOO and SPUU at 0.87. The most negatively correlated funds are the inverse products SDS, SH and SPDN at 0.87 negative, with PSQ and SQQQ at 0.86 negative. XLY therefore moved with the large-cap market but with more amplitude, which fits a beta of 1.24. For a reader comparing it with its broad-market cousin, the same twelve rules on VV produced a smaller range of outcomes, since VV had a shallower drawdown and lower volatility over the same dates.
Months, trend filters and the largest sessions
The month-of-year averages for XLY are widely spread. November averaged 5.12% and July 4.24%, while September averaged negative 1.9% and February negative 1.56%. Each month shows up five or six times in 5.74 years, and July is a good example of how thin that is: the best single month in the whole window was 2022-07 at 17.99%, a rebound inside the bear year, and one month like that lifts the July average on its own. The worst month was 2022-04 at negative 11.72%. Read the averages as a description of this sample. No template here used the calendar except the first-to-last-day rule, and its 43.81% maximum drawdown shows what holding through the bad months cost it.
Day-of-week averages are small. Monday averaged 0.13%, Friday 0.08%, Wednesday 0.05%, Tuesday 0.01% and Thursday negative 0.08%. The lag-1 autocorrelation of daily returns was negative 0.02. A rule keyed to the weekday or to yesterday's return had no edge to find in these figures.
The fund spent 65.06% of sessions above its 200-day average, which is a modest share for a large-cap fund, and it crossed the average 59 times. That is a choppy trend record. It explains why every trend template that depends on the 200-day line sits near the bottom of the ranking. The 200-day regime filter lost 2.16% a year, and the SMA-200 trend rule with a 15% trailing stop lost 4.4% a year with a 39.69% maximum drawdown, the deepest of the twelve. A rule that leaves after the average is broken and returns after it is regained pays for each false signal twice, once in the exit price and once in the entry price.
The largest sessions cluster in two periods. The best day was 2025-04-09 at 10.79%, and the next best, 2022-11-10 at 7.27%, fell in the 2022 recovery attempt. The worst day was 2022-05-18 at negative 6.54%, followed by 2025-04-03 at negative 5.97% and 2022-05-05 at negative 5.49%. Four of the five worst days came in 2022. The fund had 24 separate 20-day windows with a drop of 10% or more, covering 98 days in total, so large declines were frequent enough for loss-limiting rules to be tested many times. They were tested, and the results were mixed: the trailing-stop momentum rule at 3.83% a year kept its maximum drawdown to 18.35%, while the stop on the SMA-200 rule did not prevent its 39.69% decline.
XLY moved closely with the large-cap index. Its correlation to SPY was 0.87 and its beta 1.24, and the funds it matched most closely were VV at 0.88, SSO, SPY and VOO at 0.87. The correlation to QQQ was 0.86 with a beta of 0.89. Against the technology fund XLK, which held at 22.07% a year, XLY held at 6.27%, yet all of the top three XLY templates beat holding: the weekly 7% target at 10.19%, the RSI(2) snapback at 8.2% and the RSI(14) rule at 7%. On XLK none of the twelve did. The staples fund held at 5.8%. Funds with weak buy-and-hold results in this window left more room for rules that harvest rebounds, and funds with strong results left none.
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
What was the best strategy for XLY?
Of the 12 templates tested on XLY over 2021-01-04 to 2026-10-02, the strongest by CAGR was weekly 7% target at 10.2% (max drawdown 24.7%), versus 6.3% for buy-and-hold. The best result in hindsight is not a forecast. Check drawdowns and trade counts before drawing conclusions.
Did any strategy beat buying and holding XLY?
3 of 12 templates beat XLY buy-and-hold (6.3% CAGR) on this window; 10 of 12 had a shallower maximum drawdown than holding (39.1%).
Which strategy did best on XLY?
The weekly 7% target had a CAGR of 10.19% against 6.27% for buy-and-hold, with a max drawdown of 24.73% and 130 round trips. The RSI(2) snapback came second at 8.2% with a 16.62% drawdown. Both fell sharply in the cost runs.
How many strategies beat buy-and-hold on XLY?
Three of twelve beat it on CAGR: the weekly 7% target, the RSI(2) snapback and the RSI(14) mean reversion. Ten of twelve had a shallower max drawdown than the 39.06% for holding. Nine ended with a positive CAGR.
How far did XLY fall in 2022?
The calendar-year return for 2022 was 36.28% negative. The price drawdown was 39.67% from 2021-11-19 to 2022-12-28, and the fund took until 2024-11-06 to recover. The underwater stretch lasted 743 sessions.
Do trading costs change the XLY results?
For fast rules, yes. The weekly 7% target fell from 10.19% to 4.71% at 5 basis points and 2.74% at 10. The RSI(2) snapback fell from 8.2% to 5.38% and 2.67%. The slow rules lost little, for example the dip buyer stayed at about 4%.
Why did the 200-day regime filter lose money on XLY?
XLY crossed its 200-day average 59 times, and the rule won only 23% of 30 round trips. Its profit factor was 0.7 and it made 13 round trips in 2026 alone. The result was a CAGR of 2.16% negative.
Does oversold RSI work as a buy signal on XLY?
It depends on the length. RSI(2) below 10 had a median forward 20-day return of 1.8%, above the baseline of 0.77%. RSI(14) below 30 had a median forward 20-day return of 0.78% negative. Only the short reading showed an edge in this window.
What are the limits of this backtest?
It covers one window from 2021-01-04 to 2026-10-02 and one starting date. The headline run has no fees or slippage. The results are hypothetical and are not a forecast.
Other sector etfs
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.