I am pointing out some important issues with these 2 fundamental pieces of software for Interactive Brokers automated trading.
I am asking the IB developers to fix these issues, especially the Gateway re-login (which is a deal killer), and I hope that you can also contribute by indicating possible other problems and, of course, proposed solutions.
** IB GATEWAY **
referring to ("latest") version: Build 963.3m, Dec 20, 2017 10:15:55 AM, default installation
Issue#1: Program asks confirmation before relogin. (This had been fixed long time ago, in a previous version of the Gateway, but is re-appearing in this release.)
This totally kills automated trading. Making the gateway utterly useless, because on the first Internet disconnection we are done.
Instead, after the very first login - not matter what - the program must keep trying and relogin automatically (absolutely no confirmation asked.)
Issue#2: When testing automation in paper trading accounts, gateway keep filling the screen with annoying popups (and not just one, on first login, but keeps opening them). This should not happen. Under no circumstances the Gateway has to open popups. All communication must happen through the API messaging system.
... please add yours
** IB API **
referring to version: Build 9.73 c#
Unmanaged exceptions
If there is nothing listening on the chosen port, or the port is forbidden or already in use we get through error_Handler(e As System.Exception) the following: "No connection could be made because the target machine actively refused it 127.0.0.1:4002" and this is ok.
(Although I would possibly avoid to have 3 different error handlers. Which is quite ugly and source of confusion. Anyway, I know they are aware of that, as the API contain the message "Specific error message needs to be given for these requests! ". Would it not be time to fix this hole?)
However, if the port is available and Client Id is in already use, we get:
error_Handler(str As String): "Unable to read beyond the end of the stream."
Also, we are let with various undocumented and uncatched errors and bugs:
1. "Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall."
2. "Unable to read beyond the end of the stream."
3. "Unable to read data from the transport connection: An established connection was aborted by the software in your host machine."
4. "Exception of type 'IBApi.EClientException' was thrown."
...
... and who knows what else in class EDecoder. (There are at least 3 places with very obvious bugs, where exceptions are raised all the times, for instance when stopping one or multiple instrument data request with the method cancelMktData() ) ...
In all this cases, EWrapper.socketClient.IsConnected() is still reporting True, but there is no communication going on anymore, as the messaging thread (Ereader) is gone.
Ref: https://interactivebrokers.github.io/tws-api/connection.html
Quite a mess to deal with, especially considering that these API have developing for years, and these exceptions could be spotted in the very first few minutes of test by anyone actually using it in a real world trading platform.
... please add yours
I am asking the IB developers to fix these issues, especially the Gateway re-login (which is a deal killer), and I hope that you can also contribute by indicating possible other problems and, of course, proposed solutions.
** IB GATEWAY **
referring to ("latest") version: Build 963.3m, Dec 20, 2017 10:15:55 AM, default installation
Issue#1: Program asks confirmation before relogin. (This had been fixed long time ago, in a previous version of the Gateway, but is re-appearing in this release.)
This totally kills automated trading. Making the gateway utterly useless, because on the first Internet disconnection we are done.
Instead, after the very first login - not matter what - the program must keep trying and relogin automatically (absolutely no confirmation asked.)
Issue#2: When testing automation in paper trading accounts, gateway keep filling the screen with annoying popups (and not just one, on first login, but keeps opening them). This should not happen. Under no circumstances the Gateway has to open popups. All communication must happen through the API messaging system.
... please add yours
** IB API **
referring to version: Build 9.73 c#
Unmanaged exceptions
If there is nothing listening on the chosen port, or the port is forbidden or already in use we get through error_Handler(e As System.Exception) the following: "No connection could be made because the target machine actively refused it 127.0.0.1:4002" and this is ok.
(Although I would possibly avoid to have 3 different error handlers. Which is quite ugly and source of confusion. Anyway, I know they are aware of that, as the API contain the message "Specific error message needs to be given for these requests! ". Would it not be time to fix this hole?)
However, if the port is available and Client Id is in already use, we get:
error_Handler(str As String): "Unable to read beyond the end of the stream."
Also, we are let with various undocumented and uncatched errors and bugs:
1. "Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall."
2. "Unable to read beyond the end of the stream."
3. "Unable to read data from the transport connection: An established connection was aborted by the software in your host machine."
4. "Exception of type 'IBApi.EClientException' was thrown."
...
... and who knows what else in class EDecoder. (There are at least 3 places with very obvious bugs, where exceptions are raised all the times, for instance when stopping one or multiple instrument data request with the method cancelMktData() ) ...
In all this cases, EWrapper.socketClient.IsConnected() is still reporting True, but there is no communication going on anymore, as the messaging thread (Ereader) is gone.
Ref: https://interactivebrokers.github.io/tws-api/connection.html
Quite a mess to deal with, especially considering that these API have developing for years, and these exceptions could be spotted in the very first few minutes of test by anyone actually using it in a real world trading platform.
... please add yours
Last edited: