Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Momentum Algo Based on # of Days

I wrote this algorithm to possibly capture the investor psychology behind trading rather than any rational thought process. I theorized that if I measure momentum based on the number of days trading positive rather than a threshold percentage over any given time, that might perform better on certain stocks. This algo seems to work well on large cap companies with solid fundamentals. What do you all think?

4 responses

I've often considered something as simple as this, maybe with some self-optimizations around the # of consecutive days given some level of risk aversion / portfolio beta. Thanks for the share.

i saw this linked in the quantopian newsletter. Thanks for sharing this Sam! I think it's remarkable how well it tracks the market performance given that your algorithm is invested only about half the time, and never shorts!

@Sam, do you have any literature references that describe this strategy in more detail? Since I'm a newbie, the best I can do is google's #4 link: http://en.wikipedia.org/wiki/Momentum_investing

I tried running this on other securities, and could not get the algorithm to perform well on any of the others (KO attached, but I also tried 11100:BRK_B, 8554:SPY, 3766:IBM, 5938:PG, 6653:T, 4922:MMM, 8347:XOM, 1267:CAT).

Is the good performance above a lucky coincidence with F?