Open topic with navigation
API Settings
To configure API settings
- On the Edit menu select Global Configuration.
- Click API in the left pane, and select Settings.
- Use the right panel to set these parameters:
General
- Enable Active X and Socket Clients - Check to enable integration with TWS using ActiveX or socket clients including Java and C++. Download sample programs from the Software page on the IB website.
- Enable DDE clients - Check to enable integration with TWS through DDE. Download sample files from the TWS Software page on the website.
- Download open orders on connection - uncheck if you do not want to download all open orders when you connect to your API.
- Include FX positions when sending portfolio - If you have the Include FX Positions feature activated, all FX positions will be included when portfolio updates are sent the to API client. Uncheck this box if you don't want FX positions sent to the API client when the portfolio updates are sent.
- Send status updates for EFP and Volatility orders with "Continuous Update" flag - If you have Continuous Update activated for EFP or Volatility orders, all updates are sent to the API client by default. Uncheck if you don't want these updates sent from TWS to the API client.
- Use negative numbers to bind automatic orders - if checked, all orders that are automatically bound to an API client via the reqOpenOrders or reqAutoOpenOrders calls or via system-generated orders (i.e. volatility hedging orders) will be assigned negative API order IDs. Otherwise, these orders will be assigned incremental API order IDs. Volatility hedging orders will have the order ID “parent API order ID + 1” when possible.
- Create API message log file - check to create a message log file. Use the Logging Level selector to define the level of detail in the log.
- Include market data in API message - shows market data in the API log file.
- Socket port - Enter a socket port number which allows you to sync up multiple versions of TWS in your ActiveX spreadsheet.
- Logging Level - Set the level of log detail for the API text log. System gives the most general level of logging; Detail gives the most detailed level.
- Master API client ID - The API client with the specified client ID will receive all orders, even those placed by other API clients. This differs from the Client ID of “0” which will receive all orders sent from the TWS GUI.
- Timeout to send bulk data to API - define the time in seconds that TWS will wait before disconnecting the API client if data cannot be sent quickly enough.
Trusted IP Addresses
If you connect to the API through a trusted IP address, the connection is not questioned. Otherwise, you will get a verification message asking if you are sure you want to make the connection.
- Click Create to add a new trusted IP address to the list.
- Click Edit to modify the selected address.
- Click Delete to remove the selected address.