Why do I get an "actxserver" error when trying to connect to Interactive Brokers Trader Workstation with the "ibtws" command?
Mostra commenti meno recenti
I have Interactive Brokers (IB) Trader Workstation and MATLAB Trading Toolbox installed on my machine. However, when I execute the following example command, to establish a connection object, from the Trading Toolbox documentation, I get an error.
Command from documentation:
>> ib = ibtws('',7496)
Error received:
Error using actxserver (line 90)
Server creation failed. Invalid ProgID 'TWS.TwsCtrl.1'.
Error in ibtws (line 38)
What is the cause of this error and what can I do to fix the issue?
Risposta accettata
Più risposte (1)
Yair Altman
il 3 Ago 2018
Modificato: MathWorks Support Team
il 15 Lug 2025
1 voto
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 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 API and install an old version (possibly with the assistance of IB). Note that this might break other things for you - the old 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 some future release.
Another potential reason might be if you're running on Mac or Linux: Trading Toolbox support for Interactive Brokers is limited to Windows only. This is clearly mentioned in the documented system requirements. On Mac & Linux you will see the error that you mentioned because these OSes don't support COM, on which the Trading Toolbox connector to IB is based.
You can try my Java-API-based connector ( IB-Matlab ), which does not rely on COM and does not exhibit the COM interface's problems. The reliance on Java also means that IB-Matlab works on all Matlab releases since 2008, all Matlab platforms (MacOS, Linux, Windows), and all IB API versions.
Yair Altman
Categorie
Scopri di più su Financial Toolbox in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!