MATLAB Answers

3

I bought MATLAB and Trading toolbox to automate my trading with Interactive brokers (IB) in Dec. 2017, but it doesn't work.

Asked by Peter Willis on 28 Dec 2017
Latest activity Commented on by Gilles Desvilles on 23 Feb 2019
After hours of failed attempts to connect to TWS using MATLAB, it turns out that I had to download and install an earlier 32-bit R2015b MATLAB version at the link below to make it work. Apparently, ActiveX doesn't work with 64-bit applications. I also downloaded and installed an earlier version of IB's TWS API (9.71.06) as instructed by an answer to a similar question, but I'm not sure if it was necessary. Hope this helps someone.
https://www.mathworks.com/downloads/web_downloads/download_release?release=R2015b

  3 Comments

thank you so much, I wish I saw your answer before! It would have saved me hours of installing and resinstalling C++ packages.
Hi Peter
With R2015a 32 bit and API 9.73.07 and TWS 974.4m on Windows OS Seven 32 bit SP1 I get the infamous "invalid progid tws.twsctrl.1" error message.
Would you send me your API 9.71.06 ? If it works on yours, il should on mine.
Trading toolbox seems to not support IB anymore judging by the nearest dates of mathworks videos and weminars about IB, 2012 2013 at most. Crazy ...
Thank you for helping !

Sign in to comment.

1 Answer

Answer by Yair Altman on 29 Dec 2017
Edited by Yair Altman on 23 Oct 2018
 Accepted Answer

As you've noticed, using IB's COM/ActiveX API (which is used by the Trading Toolbox) has severe limitations. In addition to the 32-bit limitation, ActiveX also has the drawback of only working on Windows, and of being slower, less robust, and not as reliable as IB's other APIs ( according to IB themselves )
If you need a Matlab-IB connector without any of these limitations, then try using my IB-Matlab toolbox instead: http://undocumentedmatlab.com/ib-matlab. IB-Matlab is based on IB's Java (not COM/ActiveX) API, so it runs well on all platforms that support Matlab: Windows (both 32 and 64 bits), Mac and Linux - including all releases of Matlab and TWS.
Yair Altman

  0 Comments

Sign in to comment.