This repository contains my personal research notebooks for backtesting pair trading strategies. There are three main notebooks:
- Preliminaries – Downloads Binance price data and performs cointegration-correlation tests to identify the best pair combinations.
- Gridsearch – Runs backtests and performs a grid search to find the optimal parameters for entry and exit strategies.
- Bidask – Runs backtests while considering bid-ask spreads (incomplete).
To use these notebooks, you will need:
- Python 3.10 (or later)
- Jupyter Notebook
Additionally, make sure to clone the Binance public data repository into this folder:
git clone https://github.com/binance/binance-public-data.git
Don’t forget to create a .env
file with the following contents:
BINANCE_API_KEY=
BINANCE_API_SECRET=
- Complete the Bidask notebook