I have been looking into using Python to create a backtesting script to test mean reversion strategies based on cointegrated ETF pairs. I have broken down the process in my head into several stages, each of which will form the basis of my next few blog posts. I’m not sure how many I will have to split the whole “shebang” across, but here’s the basic outline.