This project implements a dynamic pairs trading strategy using Kalman Filters to estimate time-varying hedge ratios in cointegrated stock pairs from the Consumer Staples sector. Developed for the Data-Driven Portfolio Optimisation (IEDA3180) course at HKUST.
- Detect mean-reverting opportunities in stock pairs
- Estimate dynamic hedge ratios using Kalman Filters
- Backtest and compare strategy performance against benchmarks
- Languages & Libraries: Python, pykalman, statsmodels, matplotlib, seaborn, Yahoo Finance API
- Pair Selection:
- Engle-Granger test
- Augmented Dickey-Fuller (ADF)
- Half-life analysis
- Signal Generation:
- Rolling Z-score of Kalman-estimated spread
- Entry: Β±2.0 | Exit: Β±0.5 thresholds
- CAGR: 6.7%
- Sharpe Ratio: 1.26
- Max Drawdown: -3.5%
- Outperformed SPY and static OLS strategies in both returns and risk-adjusted metrics
code/: Backtesting and signal generation scriptsgraphs/: All the graphs generatedslides.pdf: Presentation slides
Quantitative Research Β· Kalman Filtering Β· Portfolio Optimisation Β· Time Series Analysis Β· Backtesting