Closed jvrodrisan closed 1 year ago
There is needed to relaunch the thread that manages the connection to IB, once this is done, the feed works again.
This worked for me but with an additional correction: removing the 'if' condition when calling self.conn.connect() in the IBStore reconnect() function definition. I replaced:
if self.conn.connect(self.p.host, self.p.port, self.clientId):
if not fromstart or resub:
self.startdatas()
return True # connection successful
with
self.conn.connect(self.p.host, self.p.port, self.clientId)
self.apiThread = threading.Thread(target=self.conn.run, daemon=True)
self.apiThread.start()
if not fromstart or resub:
self.startdatas()
return True # connection successful
As we all known, TWS/IBG restarts everyday, now, on the latest versions the session token lasts for a week so you don't have to enter username/password. What I am struggling to make it work, on the restart, is the live data when the IB Gateway restarts.
Looking at the code, the msg=-504 is well recognized, however, there is no way to resuscribe to the live data feed. Tried many things but there is no way to take it back.
Thanks