Use the Engle-Granger Test: Method for checking if Bitcoin (BTC) and Ethereum (ETH) two series are cointegrated
- Get hedge ratio from linear regression
- Calculate spread and check if the spread is stationary (if the spread is stationary, the two series are cointegrated)
- Augmented Dickey-Fuller Test, if P-value <=0.05: assume spread is stationary and therefore two time-series are cointegrated
├── src
│ ├── main.py # Calculating hedge-ratio and Augmented Dickey-Fuller Unit Root Test
│ ├── data.py # Collect historical price data for Bitcoin and Ethereum
│ ├── plot.py # Plot ETH/BTC price-ratio
│ └── config.py # Define path as global variable
├── plots
│ └── CoinPR.png # ETH/BTC Price Ratio
├── inputs
│ └── train.csv # Adj-Closing Price for ETH & BTC
├── requierments.txt # Packages used for project
└── README.md
- Pair of assets that have some economic link
- Compute the hedge ratio
- Use the hedge ration to compute the spread
- Test if the spread is stationary
- If its stationary, it’s a candidate for Mean Reversion Trading
- Choose Threshold for the spread
- When the spread Widens/Narrows its historical average short/long the spread
- Backtest your model
BTCUSD
: BitcoinETHUSD
: Ethereum