PureBytes Links
Trading Reference Links
|
The enhancements and modifications below are in build 8.41 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 has a new method,
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 a reqIntradayData() 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, with the nature of the data
extracted being governed by sending a string having a value of
"TRADES," "MIDPOINT," "BID," "ASK," or "BID_ASK." Bars of the first
four types contain the start time, open, high, low, close, volume, and
weighted average price during the time slice in question. The contents
of bars returned in response to a BID_ASK query differ from those
returned by the other query types, in that the open and close values
are actually the time weighted average bid, and time weighted average
offer, respectively. This makes these bars identical in nature to
TWS's "BID_ASK" candlestick chart bars. The final bar returned in
response to any reqIntradayData() request has a start time value of
"finished," allowing an API application to know when its query has
completed. The time duration of each bar 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
There are two additional parameters to reqIntradayData() calls. The
first is 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 outside of its "Regular
Trading Hours" (RTH). 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. Finally, API Beta 8.41 and TWS version 844 introduce version
2 of reqIntradayData(), adding a new parameter called "formatDate." If
formatDate = 1, dates applying to bars are returned in a format
"yyyymmdd{space}{space}hh:mm:dd," which is the same format already
used in EXECUTION_DATA messages. If formatDate = 2, those dates are
returned as a long integer specifying the number of seconds since
1/1/1970 GMT.
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>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~->
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|