Quant trading backtests
Two trading strategies backtested from 2021 to 2026, through the 2022 bear market, for the Harvard Venture Tech Summer Program.
- When
- Jun – Jul 2026
- Role
- Solo
- Built with
- Python, pandas, matplotlib
- Code
- Public code
- Links
- GitHub
- By the numbers
- 18 commits of mine over 11 working days, Jun 17, 2026 to Jul 14, 2026
What I built
A momentum strategy that only holds when four conditions agree (market regime, trend, rate of change, and volatility), and an earnings strategy that goes long on beats and short on misses after the announcement.
I kept both purely numeric on purpose: no model calls, fully reproducible from cached data. I wanted the backtest engine and look-ahead safety right before adding AI on top.
What was hard
Look-ahead bias. It's easy to accidentally trade on information you wouldn't have had yet, and it makes every result look better than it is.
Extending the window from 2023 back to 2021 changed both stories, which was a lesson in how much the test period decides the conclusion.
What I learned
The earnings strategy went from +14% to +138% between versions, and almost none of that came from a better signal. It came from portfolio construction: concentrating capital in live trades and parking idle cash in SPY.
Results
Momentum: +52.4%, Sharpe 1.02 versus SPY's 0.94, max drawdown -10.7% versus SPY's -24.5%.
Earnings (v2): +137.9%, beating SPY's roughly +120% on return, Sharpe, and drawdown.