One way to improve the performance of this strategy would be to invest more money. Look at the leverage plot: you are only fully invested once, and the average leverage over time is about 50%. So, on the average, about half of your money is sitting there and gathering dust. Clearly, if you don't sow, you won't reap.
How can you allocate all the money all the time? It's convenient that you first build a buy list, then buy the assets. So, at the time you're buying, you know how many. How would you change the code to allocate an equal amount to each asset you're buying so as to be fully invested? I'll leave it as an exercise for the reader.