I am trying to set up the Interactive Brokers Brokerage Model, with a cash account, but with an Immediate Settlement Model for options (these will be the live trading circumstances). The following code does not work, I run out of buying power on SPY options. Does setting the ImmediateSettlementModel() apply to underlying options? If not, how can I do that?

Changing the account type to MARGIN works, but I'd like it to be as close to Live trading as possible, where it will be a Cash account making Options trades with Immediate Settlement. If I did backtest and deploy to Live with MARGIN setting, would there be any consequence/conflict if the actual live brokerage account runs on Immediate Settlement? Or will the algorithm be able to handle and see immediate settlements?

Thanks!

 



equity = "SPY"
self.pip_value = 0.01
self.symbol = self.add_equity(equity, Resolution.SECOND, data_normalization_mode=DataNormalizationMode.RAW).symbol 
self.set_brokerage_model(BrokerageName.INTERACTIVE_BROKERS_BROKERAGE, AccountType.CASH)
self.security_object = self.securities[equity]
self.security_object.set_settlement_model(ImmediateSettlementModel())