Learn › Strategies › 200-Day SMA Regime Filter › XLY

200-Day SMA Regime Filter 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.

Result: 200-day regime filter on XLY turned $10,000 into $8,821 (−11.8% total, −2.2% CAGR): it trailed buy-and-hold by 8.4% per year, with a maximum drawdown 11.8 points shallower than holding (27.3% vs 39.1%).
−2.2%CAGR
6.3%buy & hold CAGR
−27.3%max drawdown
-0.09Sharpe ratio
30round trips
23%win rate
■ 200-day regime filter   ■ buy & hold, $10,000 invested 2021-01-04

Year by year

Year200-day regime filterbuy & hold
20216.7%28.5%
2022−18.6%−35.7%
20237.4%38.7%
202418.2%26.0%
2025−6.1%7.3%
2026−14.8%−7.2%

Month by month

YearJanFebMarAprMayJunJulAugSepOctNovDec
20210.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.2%−4.8%−3.3%−2.6%0.0%0.0%0.0%0.0%0.0%0.0%0.0%0.0%
20230.0%−1.4%1.0%−5.9%1.3%11.9%2.3%−1.7%−5.4%−4.7%5.4%6.0%
2024−4.3%7.7%−0.1%−6.9%0.2%3.8%2.7%−3.8%7.2%−1.7%12.7%1.1%
20253.4%−6.9%−13.1%0.0%0.3%1.8%1.8%4.5%3.5%0.1%−1.4%1.1%
20261.4%−5.1%−3.9%1.6%1.3%−4.1%−3.5%−2.2%−1.3%0.0%––

Every trade

200-day regime filter on XLY made 30 closed round trips, an average hold of 39 days, an average winner of 4.69%, an average loser of −1.90%, a profit factor of 0.70, a longest losing streak of 9. It held a position at the close on 56.1% of trading days.

EntryEntry priceExitExit priceReturnDays held
2021-10-19$91.882022-01-21$88.92−3.2%94
2022-02-02$89.762022-02-03$86.74−3.4%1
2022-02-09$90.892022-02-11$89.38−1.7%2
2022-03-29$92.042022-04-01$89.59−2.7%3
2022-04-05$90.692022-04-06$87.67−3.3%1
2023-02-01$71.762023-02-22$70.74−1.4%21
2023-03-06$70.992023-03-07$70.30−1.0%1
2023-03-31$71.242023-04-06$70.07−1.6%6
2023-04-12$71.312023-04-13$70.30−1.4%1
2023-04-14$71.182023-04-21$71.370.3%7
2023-04-24$71.832023-04-26$70.48−1.9%2
2023-04-28$71.552023-05-04$70.78−1.1%6
2023-05-08$71.672023-10-20$74.724.3%165
2023-11-03$77.982024-04-22$83.407.0%171
2024-04-24$85.702024-08-06$84.27−1.7%104
2024-08-14$87.502025-03-11$97.6511.6%209
2025-03-25$101.212025-03-31$95.45−5.7%6
2025-05-13$105.292026-02-24$114.688.9%287
2026-02-25$116.702026-03-04$114.63−1.8%7
2026-03-05$115.492026-03-09$112.39−2.7%4
2026-04-15$115.952026-05-18$115.91−0.0%33
2026-05-21$116.872026-06-04$117.330.4%14
2026-06-16$117.922026-06-18$115.93−1.7%2
2026-07-01$117.442026-07-09$114.58−2.4%8
2026-07-13$117.042026-07-14$115.83−1.0%1
2026-07-17$115.952026-07-20$115.79−0.1%3
2026-08-04$117.592026-08-18$115.96−1.4%14
2026-08-20$116.492026-08-21$117.000.4%1
2026-08-24$118.022026-08-28$116.36−1.4%4
2026-08-31$116.252026-09-01$114.85−1.2%1

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.

Largest drawdowns

PeakLow pointDepthDays to lowRecoveredDays to recover
2021-11-192023-05-03−27.3%5302024-12-04581
2024-12-172026-09-01−24.8%623not yet–
2021-11-052021-11-11−3.8%62021-11-198

Buy-and-hold's deepest drawdown ran from 2021-11-19 to 2022-12-28 and reached −39.1%.

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.2%−27.3%$8,821-0.09
5 basis points−2.7%−28.0%$8,564-0.13
10 basis points−3.1%−28.9%$8,329-0.16

Changing the parameters

VersionCAGRMax drawdownRound tripsWin rateFinal value
Published rules−2.2%−27.3%3023%$8,821
100-day SMA1.7%−24.3%2726%$10,989
150-day SMA−0.5%−24.4%3424%$9,717
250-day SMA−3.5%−29.2%3625%$8,172

How XLY behaved

MeasureXLY
Data in this test2021-01-04 to 2026-10-02 (1444 sessions)
Total return, buy and hold44.7%
Annualized volatility23.3%
Deepest drawdown−39.7% (2021-11-19 to 2022-12-28)
Up days53.0%
Average daily range1.68%
Average overnight gap0.63%
Correlation to SPY0.87
Correlation to QQQ0.86
Correlation to TLT0.11
Sessions above the 200-day average65.1%
Crossings of the 200-day average59
Falls of 10% or more from a 20-day high24

The rules

Own the asset when price closes above its 200-day average; hold cash when it closes below.

  1. WHEN the market opens · IF not invested AND yesterday's close > SMA(200) · THEN buy with 98% of the sleeve
  2. WHEN the market opens · IF invested AND yesterday's close < SMA(200) · THEN sell the whole position

One rule and one number. Price above the 200-day moving average has historically coincided with better returns and lower volatility than price below it. This template uses no crossovers and no oscillators, only which side of the long-term average the price is on.

Good for: a first systematic strategy, simple enough to audit every trade.
Watch out: price whips around the 200-day line during volatile bottoms, generating clusters of buy-sell pairs. Some traders add a small buffer band to reduce churn.

Run 200-day regime filter on XLY 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 200-day regime filter beat buy-and-hold on XLY?

Over 2021-01-04 to 2026-10-02, 200-day regime filter on XLY returned −2.2% annualized vs 6.3% for buy-and-hold: it trailed buy-and-hold by 8.4% per year, with a maximum drawdown 11.8 points shallower than holding (27.3% vs 39.1%).

How many trades did it make?

30 completed round trips over 5.7 years (60 fills), with 23% of round trips closing profitably.

Why the 200-day average specifically?

It approximates a year of trading days and has been studied across decades of data. It is not the best window for every asset. The per-ETF backtests here show where it helped and where it didn't.

Related

200-Day SMA Regime Filter on all 59 ETFsfull results table All strategies on XLY12 templates compared RSI(14) Mean Reversion on XLYsame ETF, different rulesRSI(2) Dip Snapback on XLYsame 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.