Turn a trading idea into tested, honest Python. Load and clean OHLCV data, build indicators from scratch, write vectorized and event-driven backtests with real costs, evaluate with Sharpe, drawdown and Monte Carlo, avoid overfitting, and go live carefully with paper trading and kill switches.
Module 1: Setup
Install Python the boring way, isolate every project in a venv, and lay out a repo you can reproduce a year from now.
Module 2: Getting data
Load free CSVs, understand what yfinance does and does not give you, survey broker APIs, and store clean bars as parquet in UTC.
Module 3: Working with OHLCV in pandas
Resample bars, compute simple and log returns, and build SMA, EMA, RSI and ATR from scratch so you know exactly what they measure.
Module 4: Your first strategy as code
Write a moving-average crossover as rules, turn signals into positions and positions into returns, and plot an equity curve.
Module 5: Realism
Charge yourself commissions and slippage, execute on the next bar, kill look-ahead with shift(), and size positions from ATR.
Module 6: Evaluation
CAGR, Sharpe and max drawdown; trade-level stats recovered from a vectorized backtest; and a Monte Carlo bootstrap of what else could have happened.
Module 7: Event-driven backtesting
Why vectorized code cannot model stops and limits honestly, a minimal event loop class, and order types including brackets.
Module 8: Parameter search and overfitting
Grid search, why the best cell is a lie, walk-forward analysis, the purged cross-validation idea, and how to report results you would believe from a stranger.
Module 9: Going live carefully
A broker adapter pattern for paper trading, scheduling and logging, alerts, kill switches, idempotent orders, state persistence and monitoring.
Module 10: Project
Build a complete mean-reversion system end to end, review it against a checklist, and decide what to study next.
- Build the system end to end16 min
- Code review checklist12 min
- Next steps9 min
Educational content, not financial advice.