I got returns of 48634.07% by starting the sample algorithm with 2k starting capital. It looks like it used the 1000k default starting value instead, but still calculated returns as if I started with 2k.
I got returns of 48634.07% by starting the sample algorithm with 2k starting capital. It looks like it used the 1000k default starting value instead, but still calculated returns as if I started with 2k.
Hello Jack,
Your analysis is dead on. The $2k starting capital you set when you start your backtest is used to calculate returns, but it is not used for anything else. Specifically, it's not used to limit how much capital your algorithm uses. The amount of money your algo can use is set within the code itself. If you edit your algo and change the context.max_notional and context.min_notional to numbers that are lower, you'll get a much more realistic result. (That said, buying 100 shares of Apple is more than $2000, and Quantopian will let you do that - the limits kick on the NEXT trade, the way the code is written).
Taking a step back: We definitely need to make it easier for you to manage your cash/margin restrictions. Right now it's pretty much the wild west - we let you do whatever you want, you can borrow a trillion dollars and the system just keeps going. We need to make it easier for you to put in cash and margin limits, and have Quantopian help you honor them. It's on the list for future features.
Thanks,
Dan