This is a variation of: 

https://www.quantconnect.com/tutorials/high-frequency-dynamic-pairs-trading-using-correlation-cointegration-approach/

It calculates correlation and cointegration for all pairs every day.

The problem: it should produce more trades as I add more stocks/pairs, but it does not.