Hi,
I'm seeing some weird things while backtesting. With a test with initial capital of $100K, I see on a few days, $300K or $400K were purchased.
The code has a check:
if context.portfolio.cash > X:
#buy stock of amount X
Is this not enough to prevent margin from being used?
Thanks!