Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Simple Algo using percent gains over past 2 weeks

I wrote a basic algorithm that looks at the percent gain for each company in a list of companies over the past 2 weeks and whichever company did the best in the past 2 weeks, I buy an extra 1% of my portfolio in that company, and I sell 1% of my portfolio in the company that did the worst over the past 2 weeks. Let me know if you think of ways this could be improved! (I know the algorithm is rather simple. I'm new to finance.)

2 responses

Pretty much tracks the benchmark index. Would be nice to see how it did in 2008-09

I would love to see this same algorithm but one that uses stock amount instead of percent. Like in 2 weeks, sell 100 shares of the worst performing and buy 100 shares of the best performing stock