Connect to IB Gateway.
Have a chart: 1 minute USDJPY with a test indicator that has the following code to record connection events:
protected override void OnConnectionStatusUpdate(ConnectionStatusEventArgs connectionStatusUpdate) { Print(string.Format(" OnConnectionStatusUpdate {0:dd MMM yyyy HH:mm:ss} {1}", DateTime.Now, connectionStatusUpdate)); }
break the network connection (eg turn of WiFi) for a few minutes, then turn it on again:
Results:
Output shows:
OnConnectionStatusUpdate 25 Jul 2016 16:03:34 status=ConnectionLost priceStatus=ConnectionLost previousStatus=Connected previousPriceStatus=ConnectionLost errorCode=NoError nativeError=''
OnConnectionStatusUpdate 25 Jul 2016 16:06:27 status=Connected priceStatus=ConnectionLost previousStatus=Connected previousPriceStatus=Connected errorCode=NoError nativeError=''
OnConnectionStatusUpdate 25 Jul 2016 16:06:58 status=Connected priceStatus=ConnectionLost previousStatus=Connected previousPriceStatus=Connected errorCode=NoError nativeError=''
Looking at the Chart I see the bars ending 16:05 & 16:06 are missing. These bars are also missing from Historical Data database.
If instead I disconnect IB using Control Center/Connections menu, then use the same menu to reconnect a few minutes later I get these results:
OnConnectionStatusUpdate 25 Jul 2016 16:46:17 status=Disconnected priceStatus=Disconnected previousStatus=Disconnecting previousPriceStatus=Disconnecting errorCode=NoError nativeError=''
OnConnectionStatusUpdate 25 Jul 2016 16:50:34 status=Connecting priceStatus=Connecting previousStatus=Disconnected previousPriceStatus=Disconnected errorCode=NoError nativeError=''
OnConnectionStatusUpdate 25 Jul 2016 16:50:52 status=Connecting priceStatus=Connecting previousStatus=Disconnected previousPriceStatus=Disconnected errorCode=NoError nativeError=''
OnConnectionStatusUpdate 25 Jul 2016 16:50:52 status=Connected priceStatus=Connected previousStatus=Connecting previousPriceStatus=Connecting errorCode=NoError nativeError=''
But this is inconsistent:
Historical Data (minutes) gaps are filled by NT if user disconnects and reconnects IB using the Control Center menu (so long as the disconnect doesn't span a calendar day break).
But these gaps are not filled by NT if a network disconnect occurs (such as broadband downtime) when the reconnect occurs.
The inconsistency might be due to OnConnectionStatusUpdate event not being raised for PriceStatus==Connecting (or Connected) after NT recovers from network error.
Comment