API Release Notes for Build 8.4

The enhancements and modifications below are in build 8.4 of the TWS API. For clarification on any of the items listed, refer to the appropriate section in the User's Guide, or contact IB customer service.

Enhancements
Extraction of intraday historical data for ActiveX, Socket Library, and Java API Clients

Starting with API version 8.4 and TWS version 843.0 (client version 18 and server version 16, respectively), all socket-based API technologies, including the socket client library, ActiveX, and Java, can extract intraday historical data going back 24 hours for any valid contract or combo. For this purpose, the API sends a new message, ReqIntradayData, with TWS responding with INTRADAY_DATA messages containing the requested data. Unlike market data requests, only one request for intraday data can be in process at any given time. The time span covered by the request is specified by an integer number of seconds. Data is returned in bars of a nature very similar to the bars in TWS charts, each bar containing the start time, open, high, low, close, volume, and weighted average price during the time slice in question. The final time slice has a start time value of "finished," allowing an API application to know when its query has completed. The time duration of time slices is determined by the length of time of the entire request, as is shown in this table:

Duration of request
Time slice duration
<= 2000 seconds
1 second
2001 to 10000 seconds
5 seconds
10001 to 20000 seconds
10 seconds
20001 to 30000 seconds
15 seconds
30001 to 60000 seconds
30 seconds
60001 to 24 hours (86400 seconds)
60 seconds

The nature of the data extracted is governed by sending a string having a value of "TRADES," "MIDPOINT," "BID," or "ASK." Finally, a ReqIntradayData parameter exists called "useRTH." If it is set to 0, all data available during the time span requested is returned, even data bars covering time intervals where the market in question was illiquid. If useRTH has a non-zero value, only data within the "Regular Trading Hours" of the product in question is returned, even if the time span requested falls partially or completely outside of them.

When TWS connects either to IB via the internet, or an API client application, it creates Java-based sockets of a predetermined size. If an API application intends to make intraday historical data requests that return more than 1000 bars, it is recommended that TWS be configured to increase the sizes of the buffers in both sockets. This can be done in the "settings.xml" file in the user's Jts directory. It is important that TWS not be running when its settings.xml file is manually modified. In the <SystemSettings> XML element, the <ccpSocketBufferSizes> and <apiSocketBufferSizes> elements can be used for this purpose. Adding these two lines to the <SystemSettings> element in settings.xml should suffice:

<ccpSocketBufferSizes>500000</ccpSocketBufferSizes>
<apiSocketBufferSizes>500000</apiSocketBufferSizes>
Addition of "Good Till Date" to Open Order messages for ActiveX, Socket Library, and Java API Clients

Starting with API version 8.4 and TWS version 843.0 (client version 18 and server version 16, respectively), all socket-based API technologies, including the socket client library, ActiveX, and Java, have a "Good Till Date" field added to their open order messages. ActiveX clients will receive this field in their openOrder3 events, which have also had a "Good After Time" value added to them.

 

© 2001 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.