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

200-Day SMA Regime Filter 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: 200-day regime filter on XLP turned $10,000 into $9,545 (−4.5% total, −0.8% CAGR): it trailed buy-and-hold by 6.6% per year, with a maximum drawdown of 21.4% (buy-and-hold: 16.0%).
−0.8%CAGR
5.8%buy & hold CAGR
−21.4%max drawdown
-0.03Sharpe ratio
37round trips
30%win rate
■ 200-day regime filter   ■ buy & hold, $10,000 invested 2021-01-04

Year by year

Year200-day regime filterbuy & hold
202110.3%18.1%
2022−10.9%−0.7%
2023−8.3%−0.9%
202412.0%12.0%
2025−10.2%1.5%
20265.3%5.6%

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%−0.6%2.4%−8.2%−2.2%1.4%−1.0%−2.4%−0.0%5.1%−2.6%
2023−1.4%−3.5%0.1%3.6%−6.0%1.4%2.1%−2.9%0.0%0.0%0.0%−1.6%
20241.2%2.0%3.3%−1.0%2.3%−0.2%1.6%5.9%1.2%−3.5%3.8%−4.7%
2025−1.7%5.0%−3.9%−4.3%−0.5%−1.6%−1.4%1.5%−1.9%−0.4%0.0%−1.1%
20264.8%7.6%−8.2%2.8%−1.6%0.9%2.3%−0.1%−2.5%0.0%––

Every trade

200-day regime filter on XLP made 37 closed round trips, an average hold of 37 days, an average winner of 2.16%, an average loser of −1.06%, a profit factor of 0.82, a longest losing streak of 10. It held a position at the close on 64.8% of trading days.

EntryEntry priceExitExit priceReturnDays held
2021-10-19$61.522022-03-14$63.413.1%146
2022-03-16$64.772022-05-19$62.85−3.0%64
2022-05-27$65.792022-06-02$65.20−0.9%6
2022-06-03$65.762022-06-09$65.06−1.1%6
2022-07-05$65.012022-07-06$65.260.4%1
2022-07-26$65.042022-07-27$65.300.4%1
2022-07-28$66.112022-08-31$65.80−0.5%34
2022-09-13$65.782022-09-14$64.18−2.4%1
2022-10-31$65.352022-11-01$65.570.3%1
2022-11-11$66.212022-11-15$66.380.3%4
2022-11-16$66.312023-01-19$65.58−1.1%64
2023-01-25$65.812023-02-10$65.42−0.6%16
2023-02-13$66.262023-03-01$64.89−2.1%16
2023-03-03$65.372023-03-08$65.17−0.3%5
2023-03-16$65.562023-03-20$65.580.0%4
2023-03-21$66.372023-03-23$65.65−1.1%2
2023-03-27$66.682023-05-31$66.11−0.8%65
2023-06-05$66.802023-06-08$66.12−1.0%3
2023-06-09$66.292023-08-17$67.331.6%69
2023-12-14$66.752023-12-15$65.72−1.5%1
2023-12-20$66.142023-12-21$65.55−0.9%1
2023-12-27$66.362025-01-07$74.3412.0%377
2025-01-28$76.042025-03-14$75.45−0.8%45
2025-03-17$76.082025-03-21$75.61−0.6%4
2025-03-25$76.092025-03-26$75.79−0.4%1
2025-03-27$76.962025-04-07$73.69−4.3%11
2025-04-14$77.182025-05-14$76.57−0.8%30
2025-05-16$77.962025-08-01$77.80−0.2%77
2025-08-04$77.622025-09-11$77.47−0.2%38
2025-09-12$77.722025-09-16$76.98−0.9%4
2025-09-18$77.092025-09-19$76.94−0.2%1
2025-10-20$77.662025-10-22$77.14−0.7%2
2025-10-23$77.532025-10-24$77.730.3%1
2025-12-16$77.772025-12-17$77.44−0.4%1
2025-12-18$77.412025-12-19$76.88−0.7%1
2026-01-12$78.072026-09-21$82.205.3%252
2026-09-23$82.812026-09-24$82.920.1%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
2022-04-202023-12-20−21.4%609not yet–
2022-01-042022-03-11−7.8%662022-04-1939
2021-11-152021-12-01−4.3%162021-12-109

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

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)−0.8%−21.4%$9,545-0.03
5 basis points−1.4%−22.8%$9,203-0.09
10 basis points−2.1%−25.1%$8,874-0.15

Changing the parameters

VersionCAGRMax drawdownRound tripsWin rateFinal value
Published rules−0.8%−21.4%3730%$9,545
100-day SMA−3.7%−24.8%4617%$8,059
150-day SMA−0.9%−21.3%4025%$9,498
250-day SMA−1.8%−24.6%3531%$9,002

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

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

Over 2021-01-04 to 2026-10-02, 200-day regime filter on XLP returned −0.8% annualized vs 5.8% for buy-and-hold: it trailed buy-and-hold by 6.6% per year, with a maximum drawdown of 21.4% (buy-and-hold: 16.0%).

How many trades did it make?

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