LearnStrategies200-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 → 2026-07-17, $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 $9,093 (−9.1% total, −1.7% CAGR) — it trailed buy-and-hold by 9.0% per year, with a maximum drawdown 11.6 points shallower than holding (27.3% vs 38.9%).
−1.7%CAGR
7.3%buy & hold CAGR
−27.3%max drawdown
-0.05Sharpe ratio
25round trips
24%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.3%
2022−18.6%−35.5%
20237.4%38.4%
202418.2%25.9%
2025−6.1%7.2%
2026−12.3%−2.9%

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, one number, and one of the most-studied timing signals in finance: price above the 200-day moving average has historically coincided with better returns and lower volatility than price below it. This template is the purest expression — no crossovers, no oscillators, just which side of the long-term average the price sits on.

Good for: a first systematic strategy — it's simple enough to fully understand and 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.5 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–2026-07-17, 200-day regime filter on XLY returned −1.7% annualized vs 7.3% for buy-and-hold — it trailed buy-and-hold by 9.0% per year, with a maximum drawdown 11.6 points shallower than holding (27.3% vs 38.9%).

How many trades did it make?

25 completed round trips over 5.5 years (51 fills), with 24% of round trips closing profitably.

Why the 200-day average specifically?

Convention and evidence: it approximates a year of trading days and has been studied across decades of data. It isn't optimal everywhere — the per-ETF backtests here show where it helped and where it didn't.

Related

200-Day SMA Regime Filter — 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-07-17, $10,000 starting capital, no margin, fees and slippage not modeled) and do not guarantee future results. Nothing on this page is investment advice. Live trading involves risk of loss.