Backtest notes in Python

Notes from testing market data and rule-based strategies in Python.

Latest studies

All studies
Chart preview for the study
Portfolio Backtest ETF Portfolio

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 contributions#DCA#SPY
Updated Jul 22, 2026 / Yahoo Finance via yfinance, adjusted OHLCV
Chart preview for the study
Portfolio Backtest US ETF

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.

#QQQ#DCA#monthly contributions
Updated Jul 22, 2026 / Yahoo Finance via yfinance, adjusted OHLCV
Chart preview for the study
Strategy Backtest Multi-Asset ETF

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.

#ETF momentum#relative momentum#absolute momentum
Updated Jul 16, 2026 / Yahoo Finance via yfinance, adjusted OHLCV
Chart preview for the study
Strategy Backtest Multi-Asset ETF

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.

#multi-asset ETF momentum#ETF rotation backtest#cross-asset momentum
Updated Jul 09, 2026 / Yahoo Finance via yfinance, adjusted OHLCV
Chart preview for the study
Strategy Backtest US ETF

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 QQQ sector momentum backtest#sector ETF rotation strategy#ETF momentum rotation strategy
Updated Jul 08, 2026 / Yahoo Finance via yfinance, adjusted OHLCV
Chart preview for the study
Strategy Backtest US ETF

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.

#SPY#RSI(2)#RSI
Updated Jul 07, 2026 / Yahoo Finance via yfinance, adjusted OHLCV

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.