API Release Notes - Build 9.62
The modifications below are in build 9.62 of the TWS API. Please note that all the enhancements for release 9.62 require the minimum server version 43 (TWS 889).
For clarification on any of the items listed, refer to the appropriate section in the API Reference Guide, or send us an email at API Support.
The C++ API code has been refactored so it can be built on any POSIX-compliant platform. Use this new POSIX API to build a TWS API on Linux, and on Windows in non-MFC applications.
Note: Although the pre-existing public interface has been preserved, you must recompile your client applications.
This API beta release also includes a POSIX test client. The API installation directory includes these new directories for the POSIX API: PosixSocketClient and TestPosixSocketClient. The POSIX test client uses the same methods as the C++ Socket client, plus it exposes several extra methods that clients must call when data is available on a socket for read/write. Refer to TestPosixSocketClient as an example. Please note that this test client is greatly simplified. For real POSIX API applications, you will have to use a select system of some kind to manage several sockets and/or asynchronous events.
Modifications to the Precautionary Constraints in the TWS order Presets page, described in the next paragraph, has precipitated the required validation of these constraints for orders submitted through the API. Users can override this mandatory validation from the API or from within TWS. From within the API, set the overridePercentageConstraints parameter in the Order object to TRUE using “1.” In TWS, enter zero in the Precautionary Value fields that have a default, including the Size Limit and Total Value Limit fields, and ensure that there is NO value in the Percentage and Number of ticks constraint fields.
In TWS, the Precautionary Settings on the Preset page now include system default limits in both the Size Limit and Total Value Limit fields. The system-defined Size Limit is (Default Size) * 5. The Total Value Limit set by the system is 100,000 USD or equivalent. To disable these limit fields, enter zero.
The DDE for Excel API sample spreadsheet (TwsDde.xls) has been updated with the following user interface improvements:
- Removed obsolete Req Open Orders button and the rows describing Open Orders from the Orders Page.
- Renamed the Orders page to Basic Orders.
- Added a new Advanced Orders page to make it easier for users to set up and place orders that require the use of extended order attributes. Added mouseover help to describe how to set up different kinds of advanced orders (Vol, Scale, Trailing Stop Limit, Bracket, Rel). Note that the code for this new page is identical to the code for the Basic Orders page.
- Updated the descriptions and explanatory text on the Extended Order Attributes page.
- Added a new Advisors page to make it easier for Financial Advisors to place FA orders. Added mouseover help to describe how to set up different kinds of FA orders. Note that the code for this new page is identical to the code for the Basic Orders page.
- Updated the list of sample market scanners available on the Market Scanners page to include many more scan codes.
Note: The VBA code for the DDE for Excel sample spreadsheet has not been changed.
This API beta release includes a new ActiveX for Excel sample spreadsheet, TwsActiveX.xls. This new spreadsheet duplicates the functionality of the DDE for Excel API spreadsheet but internally uses an ActiveX component. One of the benefits of using this spreadsheet is that it can connect to a TWS that is running on a remote PC. The DDE for Excel API spreadsheet cannot do this.
The ActiveX for Excel API sample spreadsheet includes these tabbed pages:
General
This page is new in the ActiveX for Excel spreadsheet. It is not available in the DDE for Excel sample spreadsheet.
- Connect to TWS button: Connect to the running TWS application.
- Disconnect from TWS button: Disconnect from TWS application.
- Set Server Log Level button: Set server log level to a value specified in the Log Level cell.
- Request Current Time button: Requests the current server time and displays it in the Current Time cell.
- Reset All Properties button: Resets all ActiveX control to defaults.
Tickers
- Create Ticker button: Displays the Create Ticker form, which lets you add a new ticker to a selected empty row or modify an existing ticker on a selected row.
- Combo Legs button: Displays the Combo Legs form, which lets you create or modify combination legs or add/modify delta-neutral information to a selected ticker row.
- Generic Tick List cell: A list of generic ticks sent with a market data request. This cell is new to the ActiveX for Excel sample spreadsheet; it is not not available in the DDE for Excel sample spreadsheet.
- Market Data Refresh Rate cell: Displays the data refresh time interval.
- Snapshot check box: When checked, requests snapshot market data. In this case, the Subscription Status column displays "Snapshot."
- Request Market Data button: Requests market data for a selected ticker or group of tickers. The subscription status changes to "Subscribed."
- Cancel Market Data button: To cancel market for a symbol or group of symbols, place cursor on a row with symbol or select a group of symbols and press. The Subscription Status column displays an empty string.
- Clear Market Data button: Cancels all active subscriptions and clears market data from the page.
- Errors related to market data tickers are displayed in the Subscription Status column.
The following buttons available on the Tickers page of the DDE for Excel sample spreadsheet are NOT available on the Tickers page of the ActiveX for Excel sample spreadsheet:
- Set Refresh Rate: Not supported by the TWS ActiveX component.
- Set Processing Rate: Not supported by the TWS ActiveX component.
- Set Log Level: Moved to new General page.
- Show Bulletins: Moved to new Bulletins page.
Bulletins
This page is new to the ActiveX for Excel sample spreadsheet. It is not available in the DDE for Excel sample spreadsheet.
- Request News Bulletins button: Subscribes to News Bulletins. Subscription Status cell displays "Subscribed."
- Cancel News Bulletins button: Cancels News Bulletins. Subscription Status cell displays an empty string.
- All Day News check box: When checked, requests all news bulletins for the current day.
- Clear News Bulletins button: Cancels news bulletins subscriptions and clears the Subscription Status cell and all news bulletins from the page.
Market Depth
- Request Market Depth button: Requests market depth for the selected ticker row.
- Market Data Refresh Rate cell: Displays the data refresh time interval.
- Cancel Market Depth button: Cancel the market depth subscription for the selected ticker row.
- Clear Market Depth button: Cancels all active market depth subscriptions and clears all market depth data from the page.
- Errors related to market depth are displayed in the Subscription Status column.
The following button available on the Market Depth page of the DDE for Excel sample spreadsheet is NOT available on the Market Depth page of the ActiveX for Excel sample spreadsheet:
- Set Refresh Rate: Not supported by the TWS ActiveX component.
Basic Orders
- Create Ticker button: Displays the Create Ticker form, which lets you add a new ticker to a selected empty row or modify an existing ticker on a selected row.
- Combo Legs button: Displays the Combo Legs form, which lets you create or modify combination legs or add/modify delta-neutral information to a selected ticker row.
- Apply Extended Template button: Applies the values of the extended order attributes from the Extended Order Attributes page to the selected ticker row.
- Place/Modify Order button: Places the order specified in the Order Description cells for the selected ticker row.
Use this button to modify an order: Place the cursor on the ticker row, enter an Order Id in the Id cell, enter order information in the Order Description cells, then click the Place/Modify Order button. - Cancel Order button: Cancels the order on the selected ticker row. Enter the Order Id into the Id column when you cancel an order.
- WhatIf check box: If checked when you place an order, requests pre-trade commissions and margin information. The Status cell displays "WhatIf." This check box is new to the ActiveX for Excel sample spreadsheet. It is not available in the DDE for Excel sample spreadsheet.
- Errors related to sending orders are displayed in the Status column.
- Clear Order Statuses button: Clears order statuses from the page.
Advanced Orders
The functionality of this page is the same as Basic Orders page. It is intended to improve ease of learning for orders that require the use of extended order attributes. This page includes mouseover help for Bracket, VOL, Trailing Stop Limit, Scale and Relative orders.
Extended Order Attributes
The functionality of this page is the same as Extended Order Attributes page in the DDE for Excel sample spreadsheet.
Open Orders
- Request Open Orders button: Requests open orders sent from the current ActiveX for Excel spreadsheet.
- Request All Open Orders button: Requests all open orders for the current account. This button is new to the ActiveX for Excel sample spreadsheet. It is not available in the DDE for Excel sample spreadsheet.
- Request Auto Open Orders button: Associates newly created TWS orders with the current client (ClientId should be 0). This button is new to the ActiveX for Excel sample spreadsheet. It is not available in the DDE for Excel sample spreadsheet.
- Cancel Auto Open Orders button: Cancels association of newly created TWS orders with the current client (ClientId should be 0). This button is new to the ActiveX for Excel sample spreadsheet. It is not available in the DDE for Excel sample spreadsheet.
- Clear Open Orders button: Clears all data from the page.
The following button available on the Open Orders page of the DDE for Excel sample spreadsheet is NOT available on the Open Orders page of the ActiveX for Excel sample spreadsheet:
- Cancel Open Orders Subscription: Not supported by the TWS ActiveX component.
Account
- Request Account Updates button: Subscribes to account updates. Set the account name in the Acct Code cell. When you subscribe to account updates, the Subscription Status cell displays "Subscribed."
- Last Update Time cell: Displays the last time account values were updated.
- Cancel Account Updates button: Cancels account updates subscription. The Subscription Status cell displays an empty string.
- Request Managed Account button: Requests all managed accounts and displays them in the Managed Accounts cell as a comma-separated list. This feature is available only for FA accounts.
- Request FA button: Requests FA information. Enter a numerical value representing the type of FA data to request in the FA Data Type cell (1 for groups, 2 for profiles or 3 for account aliases). This feature is available only for FA accounts. This button is new to the ActiveX for Excel sample spreadsheet. It is not available in the DDE for Excel sample spreadsheet.
- Clear Account Data button: Cancels account updates and clears account data from the page. It also clears portfolio data from the Portfolio page.
Portfolio
- Subscribing to account updates on the Account page also subscribes you to portfolio updates.
- Exercise Options button: Exercises a selected option open position based on exercise options parameters defined on the page. This button is new to the ActiveX for Excel sample spreadsheet. It is not available in the DDE for Excel sample spreadsheet.
- Clear Portfolio Data button: Clears all portfolio data from sheet.
The following buttons available on the Portfolio page of the DDE for Excel sample spreadsheet are NOT available on the Portfolio page of the ActiveX for Excel sample spreadsheet:
- Subscribe to Portfolio Updates: Not supported by the TWS ActiveX component.
- Cancel Portfolio Subscription: Not supported by the TWS ActiveX component.
Executions
- Request Executions button: Requests executions.
- Execution Filter cells: Lets you enter criteria to filter execution data.
- Clear Executions Table button: Clears all data from the page.
The following button available on the Executions page of the DDE for Excel sample spreadsheet is NOT available on the Executions page of the ActiveX for Excel sample spreadsheet:
- Cancel Executions Subscription: Not supported by the TWS ActiveX component.
Historical Data
- Create Ticker button: Displays the Create Ticker form, which lets you add a new ticker to a selected empty row or modify an existing ticker on a selected row.
- Combo Legs button: Displays the Combo Legs form, which lets you create or modify combination legs or add/modify delta-neutral information to a selected ticker row.
- Request Historical Data button: Requests historical data for the selected ticker row containing query information in the Query Specification columns. The Request Status cell displays "Processing" when you request historical data. Historical data is displayed on a separate page, the name of which is specified in the Page Name cell. After that, the Request Status displays to "Finished."
- Cancel Historical Data button: Cancels historical data subscriptions for a selected ticker row. The Request Status cell displays an empty string.
- Errors related to historical data are displayed in the Request Status column.
Contract Details
- Request Contract Details button: Request contract details for the selected ticker row. The Request Status cell displays "Processing." Contract details are displayed on a separate page, the name of which is specified in the Page Name cell. After that, the Request Status cell displays " Finished."
- Errors related to contract details are displayed in the Request Status column.
Bond Contract Details
- Request Bond Contract Details button: Requests bond contract details for the selected row containing the symbol, CUSIP or ISIN. The Request Status cell displays "Processing." Bond contract details are displayed on a separate page, the name of which is specified in the Page Name cell. After that, the Request Status cell displays "Finished."
- Errors related to bond contract details are displayed in the Request Status column.
Real Time Bars
This page is new in the ActiveX for Excel spreadsheet. It is not available in the DDE for Excel sample spreadsheet.
- Create Ticker button: Displays the Create Ticker form, which lets you add a new ticker to a selected empty row or modify an existing ticker on a selected row.
- Request Real Time Bars button: Requests real time bar data for selected ticker row or group of rows with query information entered in the Query Specification cells (What To Show and RTH Only). The Subscription Status cell displays "Subscribed."
- Cancel Real Time Bars button: Cancels real time bars for a selected ticker row or group of rows. The Subscription Status cell displays an empty string.
- Clear Real Time Bars button: Cancels all active subscriptions and clears real time bar data from the page.
- Errors related to real time bars are displayed in the Subscription Status column.
Market Scanner
- Request Scanner Parameters button: Requests scanner parameters. This button is new to the ActiveX for Excel sample spreadsheet. It is not available in the DDE for Excel sample spreadsheet.
- Request Scanner Subscription button: Requests market scanner results for the selected row with specified scanner parameters entered in the appropriate cells. The Status cell displays "Processing." Market scanner data are displayed on a separate page, the name of which is specified in the Page Name cell. After that, the Status cell displays "Subscribed."
- Cancel Scanner Subscription button: Cancel the market scanner subscription for the selected row. The Status cell displays an empty string.
- Errors related to market scanners are displayed in the Status column.
Fundamentals
This page is new in the ActiveX for Excel spreadsheet. It is not available in the DDE for Excel sample spreadsheet.
- Request Fundamentals button: Subscribes to Fundamentals data for the selected ticker row with a specified Report Type (estimates, finstat for financial statements or snapshot). The Fundamentals Subscription Status cell displays "Processing." Appropriate fundamentals data are displayed on a separate page, the name of which is specified in the Page Name cell. Please note that the parsing of the fundamentals data XML string can take some time. After parsing is complete, the Fundamentals Subscription Status cell displays "Subscribed."
- Cancel Fundamentals button: Cancel the Fundamentals data subscription for the selected ticker row. The Fundamentals Subscription Status cell displays an empty string.
- Fundamental Ratios button: Subscribes to Fundamentals Ratios data for the selected ticker row. The Fundamental Ratios Subscription Status cell displays "Processing." Appropriate fundamental ratios are displayed on a separate page, the name of which is specified in the Page Name cell. After parsing is complete, the Fundamental Ratios Subscription Status displays "Subscribed."
Advisors
The functionality of this page is the same as Basic Orders and Advanced Orders pages. It is intended to improve ease of learning for FA orders. This page includes mouseover help.
Log
This page is new in the ActiveX for Excel spreadsheet. It is not available in the DDE for Excel sample spreadsheet.
- This sheet unconditionally displays all error messages.
- Clear Log button: Clears all log messages from the page.
Note: The Conditional Orders and Executions Reporting pages on the DDE for Excel spreadsheet are NOT included in the ActiveX for Excel spreadsheet because they are not supported by the TWS ActiveX component.
ContractDetails now passes the following additional information to the client:
- The PrimaryExchange field is populated.
- There is a new field called longName that contains the descriptive name of an asset.
This enhancement requires the minimum server version 43 (TWS 889).
There is a new callback, tickSnapshotEnd(), that is called called to notify customers when a snapshot market data subscription has been fully handled and there is nothing more to wait for. This also covers the timeout case.
This enhancement requires the minimum server version 43 (TWS 889).
This release includes important bug fixes and supercedes the previous API Beta release, 9.61. If you have already installed the 9.61 beta release, we advise you not to use it. You should install this 9.62 Beta release instead.
The generic tick type RTVolume (Integer ID Value 233) is now accessible via the API and recognized by the test clients provided with the API software installation. Note that this change does not affect the library code.
Also, a new flag called mdoff has been added to the generic tick tags string. mdoff blocks regular market data so that only specified generic ticks are received. In response to a 233,mdoff request, pure RTVolume data will be returned without any additional records.
This enhancement requires the minimum server version 43 (TWS 889).
The way TWS handles API order IDs for orders that automatically bind to an API client as a result of reqOpenOrders or reqAutoOpenOrders calls or volatility hedging orders has been changed. Users now have the option of configuring TWS to use negative API order ID numbers (-2, -3, -4, and so on) in these situations.
On the TWS Global Configuration API screen, there is a check box called "Use negative numbers to bind automatic orders." If this flag is checked, orders that are automatically bound to an API client as a result of reqOpenOrders or reqAutoOpenOrders calls or system-generated orders like volatility hedging orders, will be assigned negative API Order ID numbers. If this flag is unchecked, orders bound as a result of reqOpenOrders or reqAutoOpenOrders calls will be assigned incremental API Order ID numbers. Volatility hedging orders will be assigned API Order ID numbers in the format “parent order API ID + 1” when possible.
If your favorite API application stops working, uncheck the "Use negative numbers to bind automatic orders" box on the TWS API Configuration screen.
This enhancement requires the minimum server version 43 (TWS 893).
© 2001 - 2009 Interactive Brokers LLC. All rights reserved. Sun, Sun Microsystems, the Sun Logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Excel is a trademark or registered trademark of Microsoft Corporation in the United States and/or other countries.

