MATLAB Answers

Jeff Koh
0

Unable to connect to Interactive Brokers after installed 2018a in new Laptop

Asked by Jeff Koh
on 11 Mar 2019
Latest activity Answered by Yair Altman on 12 Mar 2019
Hi Sir/Mdm,
I just re-install TWS and Matlab in my new computer. And I discover that I was unable to connect the trading tool box to my interactive broker TWS.
I have ensure I follow the istruction to installed TWS trading software and the TWS API.
I have also ensure "Enable Active X and Socket Clients" is checked.
I still encountered this error:
>> ib = ibtws('',7496)
Error using actxserver (line 90)
Server creation failed. Invalid ProgID 'TWS.TwsCtrl.1'.
Attached is the setting for API in TWS
2019-03-11 23_31_52-Clipboard.jpg
Error in ibtws

  0 Comments

Sign in to comment.

1 Answer

Answer by Yair Altman on 12 Mar 2019

Sometime in recent years, presumably around TWS API 9.70, IB changed their COM server's ProgID from 'TWS.TwsCtrl.1' to 'TWS.TwsCtrl'. This breaks the Trading Toolbox code, which still assumes a ProgId of 'TWS.TwsCtrl.1'. Since the Trading Toolbox's code is encrypted, you cannot modify its expected ProgId. The best you could do is to try to uninstall your IB API and install an old version (possibly with the assistance of IB). Note that this might break other things for you - the old IB API version might not be fully supported by IB today, but it's worth trying. And of course you could report this to MathWorks and hope that a fix or workaround will be provided in a future release.
As an alternative, you could try to use my IB-Matlab connector instead (http://undocumentedmatlab.com/IB-Matlab). IB-Matlab is based on IB's Java API (not COM), so it runs well on all platforms that support Matlab (Windows, Mac and Linux), and does not exhibit the problems that are common with the COM-based interface, such as the one that you encountered. It is by far the highest-rated product on IB's Marketplace.

  0 Comments

Sign in to comment.