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.)