Posted Tuesday July 24 2012
i have a recurring problem with the data connection from RE to IB. I use most of the time the IB gateway and not the TWS which works fine for me.
At about 6:30 CET there is a maintenance window from IB where the data connections are closed for a short time.
The broker connection is always recreated after this break but the data connection dies sometimes without any notifications.
To investigate this problem i created a copy of the TWS plugin used only for data connection and added addtional logging, From this log i can see that there is no error notification from the IB gateway in those cases when no reconnect occurs. This error happens (as always in IT) in a not reproducable manner.
It looks like that this error occurs in the most cases for FX data, in seldom cases for stock data .
I had times in the past when there has been no problem for two weeks. Currently i have the issue every day. Only the data connection is affected. The broker connection gets always reconnected.
As there is no event sent by the IB gateway RE cannot recognize this error.
I've implemented a timer based check in my RE scripts to check if the data connection is broken, If so a mail alert is sent. The only way to resolve this isssue at the moment is to stop and restart the data connection manually in RE.
I've tried also to resolve this problem within the plugin. But i have not a clue how to synchronize the timer event thread to the RE plugin thread. So currently i can detect the problem in the plugin. Which means that the "_connect" flag gets changed in case of disconnection but i am not able to send the error event notification back to RE.
My first apporach was to to use an AutoIT skirpt for reconnection. This works fine (using MSMQ and a scheduled task), but only if a console is connected to the server which is not always the case (i use only remote RDP on my server).
I am really satisfied with the RE software (stability & open architecture) but this problem which is for sure not an RE issue gets me sick.
Currently i see only two ways to solve this problems:
1) someone can give me a hint how to implement a timer event in the TWS plugin to send a reconnect notification to RE
2) in RE an option gets implemented to check the data client on a periodic basis becasue the "data disconnected" property/event itself is absolutely not reliable when connected to IB