I have done automated trading before, and have a lot of pair trading experience, but only on Multicharts, Tradestation, and Quantopian, so I am a little unclear how your live trading code works. I cloned your notebook and upgraded to the $20/month Quantconnect account, and then as a test ran your strategy live in my IB account (it is Sunday so there were no trades) and then turned it off.
Everything looks good, the only thing I don't understand is how it knows how much money to trade. If I have $30,000 in my IB acccount (all cash, no stock holdings) and your notebook has the setting self.SetCash(10000) I assume that means it would do a $10,000 trade. But for pair trading, does that mean it would trade $10,000 of each stock in the pair, or $5,000 of each stock for a total of $10,000?