We provide several APIs which you can use to link to our system and trade your IB account. The API allows you to connect through either the TWS or the IB Gateway. Connecting through the TWS requires that you have the application running, but also allows you to test and confirm that your API orders are working correctly. Connecting through the IB Gateway allows you to use the AIP without a large GUI application running, but does not provide an interface for you to test and confirm API activity.
Regardless of the connection method you use, the API allows you to:
· Run multiple sessions off the same IB login.
· View market data.
· Submit, modify, and cancel basic and advanced orders.
· View open orders.
· View updated status of your account balance and portfolio.
· View historical data and run market scanners.
To view syntax for specific functionality, see the DDE for Excel, ActiveX, C++ or Java topics in this guide. Customers with no programming expertise should begin with the DDE for Excel section, which uses an everyday Excel® spreadsheet to link to TWS via the API. The API provides multiple development methods to connect, including:
· The DDE component to link through Excel (for Windows platforms only).
· The ActiveX control to link through a Visual Basic and .NET application (on Windows platforms only).
· The Windows C++ socket client component to link through a C++ application (for Windows platforms).
· The Java API to link from a Java application (for all platforms).
API topics are written for experienced programmers and provide little guidance for non-technical users.
To develop and test your API program, we recommend that you use the sample application and connect via TWS. Once you are satisfied that the API works as designed, you can use the GUI-less IB Gateway to connect, if you desire.
To use the API components and view sample source code and spreadsheets
Install or upgrade the latest API and sample files from the IB website. On the Trading menu, select API Solutions, then click the IB API button. Click Download latest version under the appropriate OS column and install the program on your computer.
Configure the application to support the API.
Use the sample application to learn how to request market data, submit orders, etc.
Customize the sample applications to meet your needs, or create your own application using described syntax and functionality.