IB API Newsletter - April 12, 2004

Many of the discussion threads in our API chat forum center around trying to decide which is the best programming technology for creating TWS API applications. Although we also support DDE, ActiveX and C++, we believe that using the Java programming language is the quickest and most efficient way to access our trading system via the API.

Since its release in 1995, Java has proven to be a reliable and relatively simple tool for developing complex, robust financial applications that can efficiently process large amounts of complex data. By downloading the free Java Software Development Kit (SDK) from Sun Microsystems, a trader with minimal programming experience can quickly put Java to work building a TWS API application designed to meet his specific needs. Even traders who currently use other technologies will benefit from downloading Java, as it will enable them to run the API Java Test Application. This can be used to learn how the API works, and to compare the functionality of their applications to that of the proven IB Java Test Application. For example, a developer who is having difficulty programming the placement of orders can look at how the Java Test Application does it.

The instructions below walk you through downloading and installing the J2SE SDK on a PC running Microsoft Windows, and show you how to put it to use building and running the IB Java Test Application. It is available for free at the URL below.

1. Download and install the Java Software Development Kit (SDK) from http://www.java.sun.com/j2se/1.4.2/download.html. You might want to put it into the C:\Program Files\Java\j2sdk1.4.2_03 directory.
Please note that you need to install the J2SE SDK, but not the J2SE Java Runtime Environment (JRE).

2. Add the bin directory in your new J2SE SDK installation to your system path. This is done via Start->Settings->Control Panel->System->Advanced->Environment Variables. Here's a simple path that would work:
C:\WINNT;C:\WINNT\system32;C:\Program Files\Java\j2sdk1.4.2_03\bin.

3. Install the IB API download from http://www.interactivebrokers.com/cgi-bin/apiControl.pl.

4. Run a DOS window via Start->Programs->Accessories->Command Prompt.

5. Change the directory via the cd DOS command to the Java directory in the IB API install.

6. Compile the Java API client via javac TestJavaClient\Main.java.

7. Run it via java TestJavaClient.Main.

8. If anything remains uncompiled, you may do javac on it from the same directory. Also, you can use the javac command on any files you modify, in the same way.

9. If you get any error messages, you may just comment them out, by starting the line they are on with a "double forward slash" (//).

10. You may edit the .java files with Wordpad.

11. You are now a Java developer. Borland's JBuilderX Developer is a very good Java software development environment, and Bruce Eckel's Thinking in Java can provide you with further information about the Java language.

For more information on our Application Program Interface, please refer to the API Reference Guide.

To unsubscribe to this list, click here.