Hi, I have a question related to the topics discussed here.
In live trading, I'm trying to send a "MOC" order to Interactive Brokers, and the orders appear to be correct on the TWS blotter, but IB won't accept my order, with the error message:
"Rejected by System: Invalid OCA Handling method."
I've tried sending the MOC order with these lines:
self.sell(data=self.datas[1], size=100, exectype=bt.Order.Close, valid=bt.Order.T_Close)
self.sell(data=self.datas[1], size=100, orderType='MOC', valid=bt.Order.T_Close)
But if I manually create a MOC order on TWS, with the same TIF/Order Type attributes, it gets accepted without errors.
Any thoughts on this? Thanks