¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Python reqMktData blocking?


 

Group -

I fire up gateway and issue a few method calls:

def connectAck(self):
? ? print(f"somestuff")
? ? self.reqCurrentTime() # triggers callback currentTime()
? ? self.build_portfolio() # i have a dict of symbols I'm building?market data for
? ? self.get_snapshots() # iterate over symbols calling self.reqMktData(sym, c, "", True, False, [])

I if i place another method call here after get_snapshots (effectively reqMktData), it never
fires.? Is reqMktData blocking even if you only request snapshots?? I'm planning to keep
it open and continue handling tickPrice and tickSize callbacks indefinitely, but I'd like to
be able to issue other commands in the class.

Input on expected behavior here appreciated.

Thanks!


 

OKAY, so i was wrong!

I am able to print post request, but things are working very asynchronously.

Next question:

I have callback on reqMktData:? tickPrice and tickSize.? Is there a consolidated way to
handle ticks without two functions?? I see people talking about this, so seems there
must be.

Thanks!


 

That's probably the only case where it is NOT fully asynchronous aside of RTVolume tickkind in reqmkdata (which are NOT tick level)

As per IB: You ALWAYS have a tickSize after you have a tickPrice, seems the way IB solved that.

Documented

you even have too many (by 1 in one case)

?