Here's a video guide to using the Interactive Brokers API with Matlab.

http://www.maxdama.com/2008/12/interactive-brokers-via-matlab.html

As interesting as this method is, it has a limitation. That is it cannot run on other OS other than Windows. Because Max Dama used ActiveX to connect MATLAB and TWS.

Inspired by Max's method, basically, writing his own Data adapter between Matlab and Interactive Broker, I took a look at IB API. IB API provides several ways for other softwares to make use of IB API(http://www.interactivebrokers.com.hk/en/p.php?f=programInterface&ib_entity=hk): 1. DDE for Excel; 2. Java; 3. ActiveX; 4. C++.

Out of these four, DDE and ActiveX is dedicated to Windows only; C++ and Java is possible ways to be cross-platform. Out of these two cross-platform interface, my personal preference is Java.

One reason is Java is "more" cross-platform" than C++. For example, C++'s portability depends largely on the library that you choose. If you happen to choose a Windows-only library, e.g., .NET Framework, then your C++ program is as good as Windows-only program. On the contrary, Java's libraries are all .class files, they're independent of Operating systems truly.

Second reason is Java is more capable of "talking" to other softwares, such as MATLAB. There're numerous other valid reasons that make me prefer Java, such as Java is faster and easier to develop. Java is open source and very popular (No. 1 programming languages, generally speaking). And things like that.

An disadvantage of choosing Java instead of C++ that I can think of right now, is it seems Windows platform and .NET platform is more accepted as trading platform and development language, such as QD, RE, OQ, etc. For me, although less choices for Java don't make me happy, but it doesn't bother me much either. Since I have no intention of using those proprietary third-party trading platforms. They're either not flexible or not easy to develop customized trading strategies. The difficulty level is similar with using Java. So I wouldn't give up on Java and portability, because some vendors choose Windows platform only.

Comments

Popular posts from this blog

Mathematica vs Matlab vs Maple, discuss (Wilmott Forums)