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.
Year by year
| Year | 200-day regime filter | buy & hold |
|---|---|---|
| 2021 | 6.7% | 28.3% |
| 2022 | −18.6% | −35.5% |
| 2023 | 7.4% | 38.4% |
| 2024 | 18.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.
- WHEN the market opens · IF not invested AND yesterday's close > SMA(200) · THEN buy with 98% of the sleeve
- 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.
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
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.