Hi All,
I have created a simple algorithm to sell bear call spreads using the OptionStrategies.BearCallSpread method.
I'm just trying to get my head around the system, so this is very simple.
The issue I have is that I am getting unexpected errors of insufficient buying power. I'd expect this code to place a bunch of combo orders pretty quickly, and indeed run out of buying power. However, it reports lack of buying power almost immediately. It's trying to sell a five dollar wide SPY call spread, so the maximum risk should be $500.
A typical error is:
Backtest Handled Error: Order Error: id: 3113, Insufficient buying power to complete order (Value:371), Reason: Id: 3113, Initial Margin: 372, Free Margin: 0
Order Error: id: 3114, Insufficient buying power to complete order (Value:-313), Reason: Id: 3114, Initial Margin: -314, Free Margin: 0
Weirdly this happens when the simulation is at 9645.00 equity and only 210.00 holdings.
Am I horribly confused about this works??