A study in evaluating a strategy rigorously
A vectorised, from-scratch MA-crossover backtester on US-equity ETFs. The deliverable is not a winning strategy: an honest evaluation that cannot reject zero skill, and says so.
00Overview
A vectorised from-scratch backtester for moving-average-crossover strategies on liquid US-equity ETFs. The point of the project is the evaluation harness, not the rule: property-tested no-lookahead, HAC standard errors on alpha, and walk-forward folds. The strategy itself is a foil to demonstrate doing the statistics honestly.
Validation band
01Headline result
SPY · SMA(50, 200) · 2010-2024 · 5 bps per side:
The rule trails buy-and-hold by over four points of CAGR, and its alpha of +0.84%/yr is statistically indistinguishable from zero (p = 0.69). It does not even reduce risk: its worst drawdown is identical to buy-and-hold at -33.72%.
02Live chart: strategy vs buy & hold
03Walk-forward: per-fold IS vs OOS Sharpe
Each point is one walk-forward fold: in-sample Sharpe (x) against out-of-sample Sharpe (y). Points scatter around and below the 45° line; in-sample skill does not carry over.
04Why this is the right answer
A simple, well-known rule applied to a deeply liquid index, evaluated after realistic costs, should not produce alpha. If it did, the result would more likely indicate a bug or a leak than a market inefficiency. Finding no skill here is evidence the harness is honest.
This matches the literature: Bajgrowicz & Scaillet (2012) show technical-trading-rule profits vanish after data-snooping corrections and costs, and the reassessment of Brock, Lakonishok & LeBaron finds their apparent edge does not survive out of sample. Reporting the null cleanly is the result.