Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Pairs Trading

Here is a quick implementations of a pairs trading algo. Are there any suggestions for improvements (better hedging) etc? The results also seem a bit low so can anybody see any bugs because I can't find any to squash!

The logic is as such:
For the securities in the security list, compute a z score. If it is greater/less than 1 we do a pairs trade. If we are in a trade and it falls below 0.8 we close the trade.

Comments very much appreciated!
Cheers,
Max