200-Day SMA Regime Filter on SPY
SPDR S&P 500 ETF Trust: the most-traded S&P 500 ETF and a common benchmark for US large caps. Backtest 2021-01-04 to 2026-10-02, $10,000 starting capital, computed by the same engine that runs live DeployQuant strategies.
The 200-day regime filter on SPY has one input: whether yesterday's close sat above or below the 200-day simple moving average. Above, the sleeve holds the fund. Below, it holds cash. Over the test window, 2021-01-04 to 2026-10-02, that rule turned $10,000 into $15,805, an 8.3% annualized return. Buying SPY on the first day and doing nothing turned the same $10,000 into $21,820, a 14.6% annualized return. The filter gave up a large share of the gain and in return had a maximum drawdown of 17.96% against 23.99% for holding.
The rule made 15 closed round trips and left one position open at the end. Six of the 15 closed with a profit, a 40% win rate, yet the profit factor was 3.49. Two trades carried it: a 495-day hold that gained 33.39% and a 314-day hold that gained 14.09%. The other trades were small, mostly losses, and mostly clustered around the 200-day line in 2022 and early 2023.
SPY ranks seventh of the 12 strategy templates on this fund, and seventeenth of the 59 ETFs for this strategy. The table of all strategies on SPY shows where the weekly 7% target, the RSI(2) snapback and the monthly cycle did better over the same window. The 200-day regime filter hub shows the funds where the rule did better than it did here.
Year by year
| Year | 200-day regime filter | buy & hold |
|---|---|---|
| 2021 | 6.0% | 29.6% |
| 2022 | −12.4% | −17.8% |
| 2023 | 12.5% | 25.5% |
| 2024 | 24.1% | 24.3% |
| 2025 | 10.2% | 17.4% |
| 2026 | 10.7% | 13.6% |
What each calendar year did to the filter
The sleeve held cash until 2021-10-19, when it bought at an adjusted $419.68. The test data starts on 2021-01-04 and the average needs 200 sessions of history, so the first signal arrived in October. That is why 2021 shows 6.0% for the filter against 29.6% for buy-and-hold. The 23.6 point gap in 2021 is the largest single-year gap in the table, and it reflects a late start.
In 2022 the filter lost 12.4% and buy-and-hold lost 17.8%. It is the one calendar year the filter beat holding. The first trade was sold on 2022-01-24 at $404.70 for a 3.57% loss, and the rule bought again the next day. January 2022 shows a 5.5% loss for the sleeve and February a 3.3% loss. After the exit on 2022-04-12 the sleeve sat in cash through May, June and July, and a one-day trade on 2022-08-17 was the only market contact before December. The December pair of trades lost 3.8% for the month.
In 2023 the filter returned 12.5% against 25.5% for holding. The first quarter was choppy. A 49-day trade from 2023-01-23 to 2023-03-13 lost 3.57%, and a one-day trade on 2023-03-15 made 0.14%. The entry on 2023-03-17 at $376.87 held until 2023-10-26 for a 6.58% gain, and the next entry on 2023-11-02 became the best trade of the test.
2024 is the closest year. The filter returned 24.1% and holding returned 24.3%. The sleeve was invested through the whole year inside the 495-day hold, so the two curves track each other. In 2025 the filter returned 10.2% against 17.4%. The sale on 2025-03-11 at $548.94 closed the long hold, and the sleeve was out of the market for April 2025, which shows 0.0%. SPY's best day in the window, a 9.39% gain on 2025-04-09, fell inside that cash period. The re-entry on 2025-05-13 came at $573.39. The 2026 year to date reads 10.7% against 13.6%.
Across the six rows, the filter led in one year, came within 0.2 points in another and trailed in the other four. A rule that holds cash for months of a rising market trails in most years, and the single year in which cash helped was the bear year.
Month by month
| Year | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2021 | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 2.3% | −0.7% | 4.4% |
| 2022 | −5.5% | −3.3% | 1.5% | −1.9% | 0.0% | 0.0% | 0.0% | 0.1% | 0.0% | 0.0% | 0.0% | −3.8% |
| 2023 | 0.7% | −2.4% | 0.4% | 1.5% | 0.4% | 6.1% | 3.1% | −1.6% | −4.5% | −2.4% | 6.7% | 4.5% |
| 2024 | 1.5% | 5.0% | 3.2% | −3.9% | 4.9% | 3.4% | 1.1% | 2.3% | 2.1% | −0.9% | 5.8% | −2.3% |
| 2025 | 2.6% | −1.3% | −6.9% | 0.0% | 1.1% | 4.8% | 2.1% | 1.9% | 3.4% | 2.3% | 0.2% | 0.1% |
| 2026 | 1.4% | −0.8% | −3.7% | 6.3% | 5.1% | −1.1% | 0.1% | 2.6% | −0.3% | 0.9% | – | – |
Where the monthly returns came from
The month table has long runs of 0.0%, and each one is a cash period. All of 2021 up to September reads 0.0%. May through July 2022 reads 0.0%, and so do September, October and November 2022. April 2025 is the other zero. In those months the sleeve held no position and earned nothing.
The best month was November 2023 at 6.7%, inside the 495-day hold. The worst was March 2025 at a 6.93% loss. That month includes the sale on 2025-03-11 and a two-day trade from 2025-03-25 that lost 1.42%. Buy-and-hold had its best month in April 2026 at 10.33% and its worst in September 2022 at a 9% loss. The filter's worst month is milder than the holder's worst, and the filter's best month is smaller than the holder's best. Both tails are clipped, which is the shape a cash filter produces.
September 2022 is the cleanest case. Holding SPY lost 9% that month while the filter sat in cash and shows 0.0%. In months with a long position open, the sleeve's returns resemble the fund's own: 5.0% in February 2024, a 3.9% loss in April 2024, 5.8% in November 2024. A long hold behaves like buy-and-hold with a delayed start, and the delay is where most of the shortfall in the annual table comes from.
Every trade
200-day regime filter on SPY made 15 closed round trips and one position still open at the end of the test, an average hold of 82 days, an average winner of 9.36%, an average loser of −1.81%, a profit factor of 3.49, a longest losing streak of 4. It held a position at the close on 67.2% of trading days.
| Entry | Entry price | Exit | Exit price | Return | Days held |
|---|---|---|---|---|---|
| 2021-10-19 | $419.68 | 2022-01-24 | $404.70 | −3.6% | 97 |
| 2022-01-25 | $406.38 | 2022-01-26 | $413.69 | 1.8% | 1 |
| 2022-01-31 | $414.04 | 2022-02-14 | $413.80 | −0.1% | 14 |
| 2022-02-16 | $416.89 | 2022-02-18 | $410.85 | −1.4% | 2 |
| 2022-03-21 | $418.75 | 2022-04-12 | $416.60 | −0.5% | 22 |
| 2022-08-17 | $403.12 | 2022-08-18 | $403.74 | 0.1% | 1 |
| 2022-12-01 | $387.70 | 2022-12-06 | $379.27 | −2.2% | 5 |
| 2022-12-14 | $381.75 | 2022-12-15 | $374.89 | −1.8% | 1 |
| 2023-01-12 | $378.37 | 2023-01-19 | $371.70 | −1.8% | 7 |
| 2023-01-23 | $377.89 | 2023-03-13 | $364.39 | −3.6% | 49 |
| 2023-03-15 | $368.32 | 2023-03-16 | $368.84 | 0.1% | 1 |
| 2023-03-17 | $376.87 | 2023-10-26 | $401.67 | 6.6% | 223 |
| 2023-11-02 | $411.52 | 2025-03-11 | $548.94 | 33.4% | 495 |
| 2025-03-25 | $566.10 | 2025-03-27 | $558.04 | −1.4% | 2 |
| 2025-05-13 | $573.39 | 2026-03-23 | $654.19 | 14.1% | 314 |
| 2026-04-09 | $671.22 | open | – | 14.7% | – |
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.
The two trades that carried the result
The trade list holds 16 rows, 15 closed and one open. The median round trip returned a 0.51% loss and lasted 7 days. The average hold was 82.3 days, pulled upward by the long holds. The shortest hold was 1 day and the longest was 495.
The winners were few. The 495-day hold from 2023-11-02 at $411.52 to 2025-03-11 at $548.94 returned 33.39%. The 314-day hold from 2025-05-13 at $573.39 to 2026-03-23 at $654.19 returned 14.09%. The 223-day hold from 2023-03-17 returned 6.58%. Those are the only trades above 6%, and they explain why the average winner was 9.36% while the average loser was 1.81%. The longest winning streak was 3 trades and the longest losing streak was 4.
The losers cluster in time. Eight of the 15 round trips closed in 2022 and only two of the eight were wins. Four closed in 2023, with two wins. A rule that waits for a close above the average buys a bounce that fails, then sells the next time the fund closes below. The 2022-12-01 trade lost 2.17% in 5 days. The 2022-12-14 trade lost 1.8% in a single day. The 2023-01-12 trade lost 1.76% in 7 days. None of those losses is large, and between them they ate into the recovery of the sleeve's equity.
The open position was bought on 2026-04-09 at $671.22 and is marked 14.66% above entry at the last close. It is not counted among the 15 round trips, and it contributes to the final equity figure.
Prices on the page are adjusted for splits and dividends, so they sit below the quotes printed at the time. The 33.39% gain on the best trade is measured on adjusted prices.
Largest drawdowns
| Peak | Low point | Depth | Days to low | Recovered | Days to recover |
|---|---|---|---|---|---|
| 2022-01-03 | 2023-03-17 | −18.0% | 438 | 2024-01-25 | 314 |
| 2025-02-19 | 2025-05-23 | −10.3% | 93 | 2025-08-28 | 97 |
| 2024-07-16 | 2024-08-05 | −8.2% | 20 | 2024-09-19 | 45 |
Buy-and-hold's deepest drawdown ran from 2022-01-03 to 2022-10-12 and reached −24.0%.
What the drawdowns show
The deepest drawdown for the filter was 17.96%, from the peak on 2022-01-03 to a low on 2023-03-17, 438 days later. Equity regained its high on 2024-01-25, 314 days after the low. For buy-and-hold the same peak date produced a 23.99% fall to 2022-10-12, 282 days, and a recovery on 2023-12-13.
The timing difference is worth reading closely. Holding SPY reached its low in October 2022 and the filter reached its low five months later, in March 2023. The filter did not sidestep the 2022 bear market. It was in the market during January and February 2022, took losses in the December whipsaws, and was holding the 49-day trade that lost 3.57% into mid-March 2023. The drawdown was shallower than holding because the sleeve spent May through November 2022 mostly in cash. The recovery was still long because the sleeve had to rebuild through the 2023 chop.
The second drawdown, 10.27% from 2025-02-19 to 2025-05-23, took 93 days down and 97 days back. Buy-and-hold fell 18.41% from the same peak, bottoming on 2025-04-08 and recovering on 2025-06-26. The filter exited on 2025-03-11, which is why its fall was shallower. It re-entered on 2025-05-13, shortly before its own low, and its recovery came on 2025-08-28. The third, 8.19% from 2024-07-16 to 2024-08-05, was short: 20 days to the low and 45 days to recover.
Holding had a third drawdown of 8.76%, from 2026-01-27 to 2026-03-30. The filter sold on 2026-03-23 and bought back on 2026-04-09.
The filter's Sharpe ratio was 0.84 and buy-and-hold's was 0.95. The shallower drawdown did not make up for the lower return. The filter's maximum drawdown was 6.03 points shallower than holding, and its CAGR was 6.26 points lower.
With trading costs
The headline run fills at the bar price. These runs charge slippage on every fill.
| Slippage per fill | CAGR | Max drawdown | Final value | Sharpe |
|---|---|---|---|---|
| None (headline) | 8.3% | −18.0% | $15,805 | 0.84 |
| 5 basis points | 8.1% | −18.8% | $15,661 | 0.82 |
| 10 basis points | 7.7% | −19.6% | $15,300 | 0.78 |
Slippage runs
The headline run fills at the bar price. The cost runs charge 5 and 10 basis points on every fill. At 5 basis points the CAGR fell from 8.3% to 8.13% and the final value from $15,805 to $15,661. At 10 basis points the CAGR was 7.69% and the final value $15,300. The maximum drawdown widened from 17.96% to 18.84% and then 19.64%, and the Sharpe ratio went from 0.84 to 0.816 and then 0.782.
The strategy made 31 fills over 5.7 years, so costs had limited room to compound. SPY is the most liquid fund in this universe, with an average daily dollar volume of 30,453,859,411 in this data and a median minute volume of 107,870 shares. At 10 basis points per fill the filter still returned 7.69% a year. The clusters of short trades in 2022 and 2023 are where costs bite hardest. Gains such as the 0.15% on 2022-08-17 and the 0.14% on 2023-03-15 are small next to any charge on each fill.
The costs here are slippage only. The test does not include commissions or taxes.
Changing the parameters
| Version | CAGR | Max drawdown | Round trips | Win rate | Final value |
|---|---|---|---|---|---|
| Published rules | 8.3% | −18.0% | 15 | 40% | $15,805 |
| 100-day SMA | 10.1% | −15.2% | 21 | 48% | $17,412 |
| 150-day SMA | 9.5% | −17.3% | 16 | 38% | $16,814 |
| 250-day SMA | 6.8% | −17.7% | 17 | 29% | $14,551 |
Changing the window
The rule has one parameter, the length of the average. The 100-day average returned 10.14% a year with a 15.19% maximum drawdown, 21 round trips and a 48% win rate, ending at $17,412. The 150-day average returned 9.47% with a 17.28% drawdown, 16 round trips and a final value of $16,814. The published 200-day returned 8.3% with 17.96%. The 250-day returned 6.75% with 17.67%, 17 round trips and a final value of $14,551.
Shorter windows did better on this data, in both return and drawdown. The Sharpe ratio rises as the window shortens: 0.988 at 100 days, 0.933 at 150, 0.84 at 200 and 0.679 at 250. A shorter average reacts earlier to the 2022 decline and to the 2023 recovery, so the sleeve exits sooner and returns sooner. The 100-day variant paid for that with more trades, 21 against 15.
This is one path through one market. The ordering of the windows is smooth, which argues against a single lucky setting. The window still contains one bear market, and a longer data set with several declines could order the windows differently. The published 200-day setting sits in the middle of this table, neither the best nor the worst.
How SPY behaved
| Measure | SPY |
|---|---|
| Data in this test | 2021-01-04 to 2026-10-02 (1444 sessions) |
| Total return, buy and hold | 125.3% |
| Annualized volatility | 16.4% |
| Deepest drawdown | −24.5% (2022-01-03 to 2022-10-12) |
| Up days | 54.4% |
| Average daily range | 1.15% |
| Average overnight gap | 0.44% |
| Correlation to QQQ | 0.94 |
| Correlation to TLT | 0.08 |
| Sessions above the 200-day average | 78.0% |
| Crossings of the 200-day average | 30 |
| Falls of 10% or more from a 20-day high | 11 |
How SPY behaved during these years
SPY returned 125.29% on a buy-and-hold basis over 1444 sessions, with annualized volatility of 16.41% and a deepest drawdown of 24.51% from 2022-01-03 to 2022-10-12. The fund closed above its 200-day average on 77.99% of sessions and crossed the line 30 times. Those two numbers explain the filter's profile. The sleeve held a position at the close on 67.2% of trading days, and the 30 crossings are where the trades came from, with most of them landing in 2022 and early 2023.
The fund's daily behaviour gives a quick reversal rule little to work with. Lag-1 autocorrelation was negative 0.02, up days were 54.4% of sessions, and the average up day and the average down day were both 0.74%. A filter that waits for a close above a slow average is a trend rule, and trend rules need moves that persist for months. SPY supplied two in this window: the advance from 2023 into 2024, and the rise after May 2025. The filter captured both after a delay.
Calendar effects are thin. SPY's average September return in this data was negative 2.21% and November averaged 4.01%, but each month has only 5 or 6 observations.
Overnight gaps averaged 0.44% and made up 62.46% of the fund's log return in this window. Beta to QQQ was 0.69 and correlation to QQQ 0.94. For comparison, QQQ under the same rule returned 12.9% and IOO returned 11.2%, while VOO, which holds the same index as SPY, returned 8.41%. SPY and VOO finishing close together shows the rule behaves the same on near-identical funds. The gap to the Nasdaq-100 funds comes from the fund itself.
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 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.
How the two rules interact with the fund
The entry rule fires at the open if the sleeve is flat and the prior close was above the average. The exit rule fires at the open if the sleeve holds a position and the prior close was below. Both use the previous close, so a signal formed on a Tuesday close executes at Wednesday's open. A buy uses 98% of the sleeve.
There is no buffer band around the average. The template notes that price whips around the line during volatile bottoms, and that some traders add a band to reduce churn. The trade list shows the cost: from 2022-01-25 to 2023-03-16 the sleeve made ten short round trips, and most of them ended in small losses. A band would have kept the sleeve out of some of them, and it would also have delayed the entry on 2023-03-17. The test uses no band. It tests the published rule and three window lengths.
Among the other templates on SPY, the filter sits mid-table. The golden cross returned 8.71% with an 18.13% drawdown, close to the filter's 8.3% and 17.96%. The SMA 10/50 trend returned 7.94% with a 12.68% drawdown. The EMA 12/26 trend returned 10.2% with 11.84%, and trend plus a trailing stop returned 5.45% with a 31.15% drawdown. The RSI(2) snapback returned 13.17% with a 12.69% drawdown. Two faster trend rules had shallower drawdowns than the 200-day line on this fund.
The limits of the test are the usual ones. It covers 2021-01-04 to 2026-10-02, with one bear market and one sharp correction. The headline run has no fees or slippage. Decisions are daily and orders fill on minute bars. Fifteen round trips are too few to separate skill from luck, and two winning holds make up most of the profit.
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 SPY?
Over 2021-01-04 to 2026-10-02, 200-day regime filter on SPY returned 8.3% annualized vs 14.6% for buy-and-hold: it trailed buy-and-hold by 6.3% per year, with a maximum drawdown 6.0 points shallower than holding (18.0% vs 24.0%).
How many trades did it make?
15 completed round trips over 5.7 years (31 fills), with 40% 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.
Did the 200-day filter beat buy-and-hold on SPY?
Not over the full window. The filter returned 8.3% a year against 14.6% for buy-and-hold, ending at $15,805 against $21,820 from $10,000. It beat holding in 2022 only, losing 12.4% against 17.8%, and its maximum drawdown was 17.96% against 23.99%.
How many trades did the strategy make on SPY?
It made 15 closed round trips and left one position open, with 31 fills in total. Six of the 15 closed with a profit. The median round trip lasted 7 days and the longest hold was 495 days.
Why was 2021 so far behind buy-and-hold?
The 200-day average needs 200 sessions of data, and the test starts on 2021-01-04. The first entry came on 2021-10-19 at $419.68, so the sleeve missed most of the year. It returned 6.0% for 2021 against 29.6% for holding.
What happened to the filter during the 2022 bear market?
The sleeve lost 12.4% in 2022 against 17.8% for holding. January and February 2022 cost it 5.5% and 3.3%, then it sat in cash for most of May through November. December added a 3.8% loss from two short trades.
Does a shorter moving average work better on SPY?
In this window it did. The 100-day average returned 10.14% with a 15.19% drawdown, the 150-day returned 9.47%, the 200-day 8.3% and the 250-day 6.75%. The result covers one bear market, so the ordering could differ on other data.
How much did trading costs change the result?
At 5 basis points per fill the CAGR was 8.13% and the final value $15,661. At 10 basis points it was 7.69% and $15,300. The rule made 31 fills in 5.7 years, so the effect stayed modest.
Related
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.