Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Linear Long-Short Algo (Ernie Chan, Andrew Lo)

I attempted to create the Linear Long-Short Algo from the book Algorithmic Trading, Example 4.3. The strategy is to take an index of stocks and buy yesterdays losers and short yesterdays winners in proportion to how far the stocks are from the mean.

With Quantopian you're limited to 100 stocks, so the S&P 100 is used. (Minus GOOG, BRK.B, and WAG which cause problems). Trading daily.

Interestingly the algo performs surprisingly poorly and does not replicate the results described by Chan or by the original Khadhani and Lo paper. See if you can improve it!

2 responses

Timothy,

I set this strategy up to long yesterdays 5 largest loser and short yesterdays 5 largest winners in minutely mode for the last 2 years. All positions either hit a 2% stop loss or are closed at the end of the day.

The strategy did well in 2014 but tanked in mid to late 2014. I still think there's some real potential if the strategy produced less buy/sell signal and had more intelligent entry / exit points. Let me know what you think!

Very interesting Austin. You're code is pretty pythonic. What I can't understand is why my algo doesn't replicate what is in the Algorithmic Trading book.

TB