开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: No real-time data after IB nightly server reset


 

Don't do that. There is no need for you to cancel subscriptions or to disconnect/reconnect your clients during the nightly reset window and what your client does may be more harmful than helpful. Especially if you have hard-coded wait/sleep/timeout times of 50 seconds.

TWS/IBGW are remarkably reliable through the nightly reset process and all real-time subscriptions survive the reset (and in fact provide data throughout the entire reset process). That includes subscriptions for five second real-time bars but not subscriptions the historical data with keepUpToDate = true.

First, each data farm gets disconnected/reconnected individually and you get a series of "connection broken" and "connection OK" indications. In my case, each of these resets takes only a fraction of a second and all real-time data keeps arriving (MktData, Level 2, TickBytick, Realtime Bars)

Eventually, TWS/IBGW reset their main connection with IBKR and re-authenticate. That is when you may see a series of error code 1100 messages "Connectivity between IB and Trader Workstation has been lost.", count-down pop-up windows, and eventually the indication 1102 "Connectivity between IB and Trader Workstation has been restored - data maintained.". But these have nothing to do with real-time data feeds for existing subscriptions. It is just that you can't make new subscriptions, place orders, or make any API request between 1100 and 1102 that require communication between TWS/IBGW and the IBKR servers.

I often get many 1100 over a period of several minutes before the final 1102, but real-time data continues since the market data farm connections are and all stay OK (where the real-time data comes from).

And the fact that you sometimes get "The following farms are not connected: ushmds" is probably normal and not an error. Since you use IGBW, the HMDS server may simply not be needed at that time. HMD traditionally stood for Historical Market Data but those servers now seem to provide a more general purpose query infrastructure but may not be needed until you request historical data or ContractDetails, establish new real-time subscriptions, or place orders. They would automatically be connected at that point.

And coming back to the 5 second real-time bars for a moment. You did not tell us what kind of instruments and exchanges you are subscribing to but it could very well be, that there are no trades to be reported for 10 or more periods of 5 seconds in the middle of the night. Very active instruments and CME/CBOT traded instruments do get updates even for periods with no activity (volume and count is 0), but I have seen some instruments that only get bars for periods with trades or bid/ask changes.

Just remove the cancel/disconnect/connect logic and your client should get through the reset windows without any problems and with real-time data arriving. It has done so for me for years.

闯ü谤驳别苍

?

?
?
?
?
?
?
On Fri, Aug 2, 2024 at 02:19 PM, <farhanferoz@...> wrote:

Thanks, Richard for your reply. After I receive "farms not connected ..." 1102? message, I don't get a 2104 message. After the server reset once the connection is re-established, I cancel all my data subscriptions & disconnect. I then connect again (with the same client ID) & subscribe again using reqRealtimeBars with bar length 5 seconds. I wait for 50 seconds to receive market data & if I don't then I logout of IB Gateway & login again (triggering 2FA) & go through the same routine. This always works.
?
The strange thing is that I don't have this problem every single day. On the days when all farms are connected after reset, I do get the real-time data.

Join [email protected] to automatically receive all group messages.