I am not sure how I have gotten a nearly 1000% yield in a year so I think my code is broken. Help please
I am not sure how I have gotten a nearly 1000% yield in a year so I think my code is broken. Help please
It looks like the algo keeps on buying shares even when you don't want it to. In this backtest I plotted the leverage used and it gets unrealistically high. You can prevent this using several different methods. I'll post a backtest that gives an example
It's my first time using Quantopian, so I'm not really sure about this, but it looks like your cash is negative. Maybe, transactions takes some minutes to be done, so you keep buying shares, and when all the orders get executed your cash becomes negative. And because the performance is based on your initial capital, you get such a good performance.
When running this daily, your cash get updated before you can place a new order, and you get more reasonable results.