I am sharing this code for a public activity. I'm not sure how to share an algo and allow cloning without posting it to here. This is mostly straight from the example pairs trading algorithm in the Zipline examples. It's a good introduction to stat arb.