Hello.  

I am new to Quantconnect and have very little experience with Python/programming. 

I am having a bit of trouble understanding how to deal with stock splits in the underlying for open options positions.  In my backtest, I have open options positions in two different underlyings.  Since stock splits are not supported for options, the model attempts to automatically close my options on only the underlying for which the split is about to occur using a “MarketOnClose” order.  I then get the following errors, telling me that a “MarketOnClose” order is invalid for options when using the IB brokerage model. 

2021-01-08 15:44:00 :MarketOnClose order submitted for option contract 'SPXS 210115C00018000' due to impending SPXS split event. Option splits are not currently supported.
2021-01-08 15:44:00 :BrokerageModel declared unable to submit order: [7] Warning - Code: Unsupported order type for Option security type - InteractiveBrokers does not support Market-on-Close orders for other security types different than Future and Equity.
2021-01-08 15:44:00 :Time: 01/08/2021 20:44:00 OrderID: 7 EventID: 1 Symbol: SPXS 210115C00018000 Status: Invalid Quantity: 1 Message: BrokerageModel declared unable to submit order: [7] Warning - Code: Unsupported order type for Option security type - InteractiveBrokers does not support Market-on-Close orders for other security types different than Future and Equity. IsAssignment: False

I would like to override this behavior by liquidating all options positions on both underlyings, prior to a stock split in either of the two underlyings, and then wait and re-open positions after the split has occurred.  

Is it possible to override this behavior?  I tried to liquidate all the options when data contains a split with SplitType == SplitType.Warning for either underlying symbol, but again, I am getting an error saying that I can't place any orders when a split has occurred.

2021-01-08 00:00:00 :Warning: Options orders are not allowed when a split occurred for its underlying stock

 

I also have one other question.  In the backtest you can see that I am attempting to open synthetic shorts on these two underlyings.  I need to obtain the buying power requirements, per contract pair (-1 call, +1 put), per underlying, in order to calculate the multiple for the number of contracts to buy.  Since there is no option strategy for synthetics, do I need to calculate this manually or is there an API function that can do this? 

 

Thank you for your time.