Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Request for some help editing an algorithm

Credit to :Dillon Dumesnil for creating this algorithm.
I am basically trying to edit this algorithm so that every week, it will buy an additional 50 shares of the worst performing stock in the list (based on the last 14 days percent gain/loss). I would prefer to user "amount" instead of "target_percent". I also do not want it to sell anything; just buying as described above.

Here is a link for the algorithm: https://www.quantopian.com/posts/simple-algo-using-percent-gains-over-past-2-weeks

Anyone got any idea how I can make it work. Tried making the edits myself buy I keep getting errors (I just started coding a month ago).
I appreciate any help.