Backtesting Framework — Design Principles and Structural Pitfalls
Companion notebook to the Backtesting Framework article
(Backtesting & Statistical Testing, Module 1). Uses only Python stdlib
(math, random, statistics) — no external dependencies.
- §0 — Setup: synthetic return series, named constants, seed RNG
- §1 — Sharpe ratio: daily SR, annualisation (×√252), t-statistic, Lo (2002) non-Gaussian correction
- §2 — Look-ahead bias: timing leakage effect on SR, quantify inflation from a 1-day forward shift
- §3 — Walk-forward OOS degradation: IS vs OOS Sharpe across rolling windows
- §4 — Validation summary: pass/fail for all article claims