This project really got me out of my comfort zone. I created a quantitative trading tool that implements the pairs trading strategy. It was challenging, requiring research into the Engle-Granger Test, ADF Test, and basic trading logic like long/short spread entry and exit signals using z-score calculations.
The tool fetches historical price data for two user-specified stocks from Yahoo Finance over a chosen period. It conducts the Engle-Granger test to check for co-integration (whether the stock prices move together in the long term) and the ADF test to check if the spread is stationary. If the stocks are co-integrated, it monitors the spread and uses the z-score to detect divergence, executing trades when the spread exceeds a threshold.
Key performance metrics calculated include:
- Total profit/loss
- Annualized return
- Annualized volatility
- Sharpe ratio
- Drawdown
- Win rate
This project was a great learning experience in quantitative finance and algorithmic trading.