I am having trouble with my cointegration test timing out in this algo (lines 171 and 203). It is seeming to have promising results. If anyone would like to take a stab at optimizing it to see if they can get a full backtest to run (greater than 5 years), that would be great!
The hypothesis behind the algo is: equities that experience a large intraday price swing will correct overnight. In order to further confirm that the price swing will revert, I run a cointegration test against all securities in the given security's sector and make sure it is a few standard deviation events outside the mean.
Please share your thoughts and feedback!