Backtest notes in Python
Notes from testing market data and rule-based strategies in Python.
Latest studies
Monthly Contributions in SPY, QQQ, and ETF Portfolios
A reproducible monthly contribution backtest comparing SPY, QQQ, a 60/40 stock-bond portfolio, and a simple multi-asset ETF portfolio using adjusted-close data.
Monthly QQQ Contributions Through the Dot-Com Crash
A reproducible backtest of monthly QQQ contributions starting in 2000, compared with SPY contributions and QQQ's dot-com price recovery path.
Relative vs Absolute Momentum in ETF Rotation
A reproducible ETF rotation backtest comparing relative momentum with an absolute momentum cash rule using the same multi-asset ETF universe, monthly rebalance schedule, and transaction-cost assumptions.
Multi-Asset ETF Momentum Rotation Backtest in Python
A reproducible monthly cross-asset ETF momentum rotation backtest comparing Top 1 and Top 3 selection with SPY buy and hold.
ETF Momentum Rotation Backtest: SPY, QQQ, and Sector ETFs
A reproducible US equity ETF momentum rotation backtest in Python comparing monthly Top 1 and Top 3 rotation across SPY, QQQ, and sector ETFs with transaction costs, charts, CSV output, and code.
SPY RSI(2) Backtest With 200DMA Trend Filter
A reproducible SPY RSI(2) mean reversion backtest in Python comparing the strategy with and without a 200-day moving average trend filter, transaction costs, charts, CSV output, and code.
What each note includes
Rule
The rule being tested, when the signal is calculated, and when the trade is assumed to happen.
Data
The data source, date range, benchmark, and basic cost assumptions.
Result
Charts, summary metrics, code links, and known limitations.