Skip to content

About

Pairs trading strategy that includes a research pipeline for identifying and selecting pairs. Tests all possible pairs in a universe for cointegration using the Johansen test, then runs in-sample backtests on all cointegrating pairs, then runs an out-of-sample backtest on the 5 best performing pairs.

Resources

Stars

36 stars

Watchers

1 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

pairs-pipeline

Pairs trading strategy that includes a research pipeline for identifying and selecting pairs. Tests all possible pairs in a universe for cointegration using the Johansen test, then runs in-sample backtests on all cointegrating pairs, then runs an out-of-sample backtest on the 5 best performing pairs. Calculates daily hedge ratios using the Johansen test and times entries and exits using Bollinger Bands. Trading rules adapted from Ernie Chan's book Algorithmic Trading. Runs in Moonshot on the universe of US ETFs.

Clone in QuantRocket

CLI:

quantrocket codeload clone 'pairs-pipeline'

Python:

from quantrocket.codeload import clone
clone("pairs-pipeline")

Browse in GitHub

Start here: pairs_pipeline/Introduction.ipynb


Find more code in QuantRocket's Codeload Library

About

Pairs trading strategy that includes a research pipeline for identifying and selecting pairs. Tests all possible pairs in a universe for cointegration using the Johansen test, then runs in-sample backtests on all cointegrating pairs, then runs an out-of-sample backtest on the 5 best performing pairs.

Resources

Stars

36 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages