Skip to content

ctt062/Kalman-Filter-Based-Statistical-Arbitrage-A-Dynamic-Pairs-Trading-Strategy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Ή Kalman Filter-Based Statistical Arbitrage Strategy

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.

🧠 Project Objectives

  • Detect mean-reverting opportunities in stock pairs
  • Estimate dynamic hedge ratios using Kalman Filters
  • Backtest and compare strategy performance against benchmarks

βš™οΈ Techniques & Tools

  • 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

πŸ“Š Strategy Performance (Out-of-Sample: 2022–2024)

  • CAGR: 6.7%
  • Sharpe Ratio: 1.26
  • Max Drawdown: -3.5%
  • Outperformed SPY and static OLS strategies in both returns and risk-adjusted metrics

πŸ“‚ Files

  • code/: Backtesting and signal generation scripts
  • graphs/: All the graphs generated
  • slides.pdf: Presentation slides

🧰 Skills Demonstrated

Quantitative Research Β· Kalman Filtering Β· Portfolio Optimisation Β· Time Series Analysis Β· Backtesting

πŸ”— Connect

LinkedIn β€’ Email

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages