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??
Daniel Rose
Backtest attached
Jared Broad
Hey Daniel; we don't have option buying power models which factor in spread strategies yet so the buying power allocation is the full cost of both sides of the position.
In live trading, the models can be disabled so you can rely purely on the brokerage restrictions so for now, you can simply increase your allocation of cash in the backtest to get around the modeling inaccuracy.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Jared Broad
This feature should be shipped this month. We're actively working on it now.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Daniel Rose
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!