Did the 200-day moving average rule hold? The lab's four-stage test on the S&P 500, 1994-2026
Verdict: PARTLY HELD (passed every stage on risk-adjusted return, but grew less than buy and hold). Rule: hold the index while its close is above its 200-day average; hold cash otherwise. Market: SPY (the S&P 500 with dividends). Costs: 5 basis points per switch. Run 2026-11-02-ma-trend.
The four stages
| Stage | Test | Result |
|---|---|---|
| 1 Screen | best of 10 settings in 1994-2007, discounted for the tries | passed: best was 300 days, Sharpe 0.85 vs buy and hold 0.68; deflated Sharpe probability 0.98 (pass at 0.9) |
| 2 Out of sample | the 200-day rule from 2008 on, never fitted to those years | passed: Sharpe 0.82 vs buy and hold 0.63; yearly growth 9.2% vs 11.1%; worst fall -20.9% vs -52.3% |
| 3 Costs | the cost per switch at which the edge is gone | passed: break-even at 46.2 bp per switch; 5.1 switches a year |
| 4 Robustness | other settings and other markets, out of sample | passed: 90.0% of settings, 50.0% of other markets and 83.3% of start years beat buy and hold |
What held, and what did not
- Risk-adjusted return (Sharpe) from 2008: better than buy and hold.
- Growth: lower than buy and hold (9.2% a year vs 11.1%).
- Worst fall: smaller (-20.9% vs -52.3%).
Does the answer depend on the year the test starts?
The unseen period was started in each of these years in turn, the rule unchanged. (This check was added to the method after the first run of this test: from 2008 the rule beat buy and hold, from 2010 it did not, because the 2008 crash carried it.)
| Unseen years from | Sharpe | Buy and hold | Yearly growth | Buy and hold's | Worst fall | Buy and hold's |
|---|---|---|---|---|---|---|
| 2004 | 0.70 | 0.64 | 7.7% | 10.8% | -21.5% | -55.2% |
| 2006 | 0.76 | 0.64 | 8.5% | 11.1% | -21.5% | -55.2% |
| 2008 | 0.82 | 0.63 | 9.2% | 11.1% | -20.9% | -52.3% |
| 2010 | 0.81 | 0.86 | 9.3% | 14.1% | -20.9% | -33.7% |
| 2012 | 0.99 | 0.92 | 11.5% | 14.9% | -20.7% | -33.7% |
| 2014 | 0.87 | 0.83 | 9.9% | 13.5% | -20.7% | -33.7% |
Re-picking every year (walk-forward)
Choosing the setting with the best Sharpe over the previous 5 years each January, from 2008: Sharpe 0.81, yearly growth 8.9%, worst fall -22.5%. Picks: 2008: 300, 2009: 300, 2010: 75, 2011: 75, 2012: 75, 2013: 100, 2014: 100, 2015: 300, 2016: 225, 2017: 225, 2018: 200, 2019: 200, 2020: 200, 2021: 200, 2022: 250, 2023: 250, 2024: 150, 2025: 100, 2026: 150.
Every setting, out of sample
| Setting | Sharpe | Buy and hold |
|---|---|---|
| 50 | 0.46 | 0.63 |
| 75 | 0.69 | 0.63 |
| 100 | 0.82 | 0.63 |
| 125 | 0.70 | 0.63 |
| 150 | 0.78 | 0.63 |
| 175 | 0.75 | 0.63 |
| 200 | 0.82 | 0.63 |
| 225 | 0.79 | 0.63 |
| 250 | 0.75 | 0.63 |
| 300 | 0.80 | 0.63 |
Other markets, the same rule, out of sample
| Market | Sharpe | Buy and hold | Worst fall | Buy and hold's |
|---|---|---|---|---|
| QQQ | 0.78 | 0.77 | -23.9% | -50.0% |
| IWM | 0.42 | 0.46 | -28.2% | -54.3% |
| EFA | 0.35 | 0.31 | -28.8% | -58.3% |
| DIA | 0.56 | 0.60 | -21.8% | -48.9% |
How it was tested
- Daily adjusted closes (dividends reinvested) from Yahoo Finance's chart data; the signal is read at a day's close and acts on the next day, so no day uses information it would not have had.
- Cash earns nothing in this test (a money-market rate would add to the rule's side).
- The pass rules were fixed in the code before the data was read; every stage is reported whether it passed or not.
- The deflated Sharpe ratio follows Bailey and López de Prado (2014), "The Deflated Sharpe Ratio", Journal of Portfolio Management 40(5).
What this cannot tell
- One country's large stocks over about three decades is one path of history; a rule can fail on the next one.
- Taxes on each switch are not counted; in a taxable account they favour buy and hold.
- A lower worst fall can matter more to a reader than a higher Sharpe; the table shows both.