Hi,
I'm trying to run the 'wheel' strategy but for some reason the call option of my code won't work - it keeps trying to sell puts after I got assigned on a position and therefore leaves insufficient buying power.
2018-12-13 09:39:00 Time: 12/13/2018 14:39:00 OrderID: 13 EventID: 2 Symbol: SPY 181214P00262000 Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: 0.34 USD OrderFee: 1 USD IsAssignment: False
2018-12-13 09:39:00 Time: 12/13/2018 14:39:00 OrderID: 14 EventID: 1 Symbol: SPY 181214P00262000 Status: Submitted Quantity: 1 LimitPrice: 0.17 IsAssignment: False
2018-12-14 15:45:00 Order Error: id: 15, Insufficient buying power to complete order (Value:26200), Reason: Id: 15, Initial Margin: -12999, Free Margin: 4696.3000000000000000000000001
2018-12-14 15:45:00 Time: 12/14/2018 20:45:00 OrderID: 15 EventID: 1 Symbol: SPY 181214P00262000 Status: Invalid Quantity: 1 Message: Order Error: id: 15, Insufficient buying power to complete order (Value:26200), Reason: Id: 15, Initial Margin: -12999, Free Margin: 4696.3000000000000000000000001 IsAssignment: False
2018-12-15 00:00:00 Time: 12/15/2018 05:00:00 OrderID: 14 EventID: 2 Symbol: SPY 181214P00262000 Status: CancelPending Quantity: 1 LimitPrice: 0.17 IsAssignment: False
2018-12-15 00:00:00 Time: 12/15/2018 05:00:00 OrderID: 14 EventID: 3 Symbol: SPY 181214P00262000 Status: Canceled Quantity: 1 LimitPrice: 0.17 IsAssignment: False
2018-12-31 16:00:00 Algorithm Id:(8233c2823bb60b6c0ccbe5896e36449f) completed in 393.98 seconds at 127k data points per second. Processing total of 50,035,640 data points.
See attached backtest for code - can someone please explain why this is happening?
Thanks
Derek Melchin
Hi Iklcho,
`TradeCallOption` is never called because `self.Portfolio[self.ticker].Invested` is always False. To resolve the issue, we need to purchase shares in the underlying.
Best,
Derek Melchin
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.
Iklcho
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!