Hi I am testing pre market order in Live Deployment with Interactive Broker.

Initially i just used market order and the order was placed as Market On Open order..

So I used isMarketOpen(symbol) to check if the market is open. and if market is open, use marketOrder, if not, use limit Order.

 

if self.IsMarketOpen(testSymbol):
self.Debug(f"onData {self.Time} {testSymbol.Value} market is open")
tag = str(self.Securities[testSymbol].Price)
ticket = self.MarketOrder(testSymbol, 1000,False,tag)
else:
self.Debug(f"onData {self.Time} {testSymbol.Value} market is NOT open")

limitPrice = self.Securities[testSymbol].Price * 1.03 # use a higher price to get entry
tag = str(self.Securities[testSymbol].Price)
ticket = self.LimitOrder(testSymbol,1000,limitPrice,tag)
self.Debug(f"test doing limit order for {testSymbol.Value} price: {self.Securities[testSymbol].Price} limitPrice: {limitPrice}")

 

 

However the limit order remained unfilled, even though the limit price was set much higher than the last executed pre-market price.

To confirm that a limit order at that price will result in an entry, i manually did a limit order at the same price in my IB account and the order went thru.

Is there anything I missed out? Thanks a lot!