Beginning with API v 973.04, you can now request tick-by-tick historical market data from IB’s database using the function IBApi::EClient::reqHistoricalTicks. Results are returned via IBApi.EWrapper.historicalTicks, IBApi.EWrapper.historicalTicksBidAsk, and IBApi.EWrapper.historicalTicksLast, depending on the type of data requested.
For samples and more information, see http://interactivebrokers.github.io/tws-api/historical_time_and_sales.html.
Beginning with API v 973.04, the RTD Server API now supports symbol requests for symbols that include a space, for example "BRK B." Additionally, the error message handling for RTD has been improved.
For more information, see http://interactivebrokers.github.io/tws-api/tws_rtd_server.html.
Beginning with API v 973.04, the code for the ActiveX sample spreadsheet has been refactored, making the sample easier to read and extend.
To use the ActiveX sample spreadsheet, see http://interactivebrokers.github.io/tws-api/activex.html#activex_sample.
Beginning with API v 973.04, the order status message now includes the price at which an order has been limited for capped market orders.
Beginning with API v 973.04, the API samples now include ADJUSTED_LAST data type for historical data to demonstrate receiving dividend-adjusted historical data.
Beginning with API v 973.04, the tickPrice function can return preOpenBid and preOpenAsk attributes which indicate that quotes are in the exchange pre-open period.
Note: Requires Python 3.1 or greater.
Beginning with release 9.73.03, a new Python API client is now included. After you install this beta release on your computer, you can find Python API components in the following locations:
Beginning with API v 973.02, four news providers now offer news articles from the API. News from the API requires separate subscriptions, and each has different data fees, than the same news services in TWS. The API functions which handle news are able to query available news provides, subscribe to news in real time to receive headlines as they are released, request specific news articles, and return a historical list of news stories that are cached in the system.
The currently available API news subscriptions include Briefing Trader, Benzinga Pro, Fly on the Wall, and Midnight Trader.
Sign up for API news through Account Management, where you can also view current subscriptions. You can also view currently subscriptions from the API using the function IBApi::EClient::reqNewsProviders:
Requesting historical news headlines: Additionally, and with the appropriate API news subscription, historical news headlines can be requested from the API using the function IBApi::EClient::reqHistoricalNews. The resulting headlines are returned to IBApi::EWrapper::historicalNews.
Requesting news articles: After requesting news headlines using one of the above functions, the body of a news article can be requested with the article ID returned by invoking the function IBApi::EClient::reqNewsArticle. The body of the news article is returned to the function IBApi::EWrapper::newsArticle.
For samples and more information, see http://interactivebrokers.github.io/tws-api/news.html.
A single data request from the API can receive aggregate quotes from multiple exchanges. With API versions 9.72.18 and TWS 9.62 and higher, the tick types 'bidExch' (tick type 32), 'askExch' (tick type 33), 'lastExch' (tick type 84) are used to identify the source of a quote. To preserve bandwidth, the data returned to these tick types consists of a sequence of capital letters rather than a long list of exchange names for every returned exchange name field. To find the full exchange name corresponding to a single letter code returned in tick types 32, 33, or 84, and API function IBApi::EClient::reqSmartComponents is available.
Different IB contracts have a different exchange map containing the set of exchanges on which they trade. Each exchange map has a different code, such as "a6" or "a9". This exchange mapping code is returned to IBApi::EWrapper::tickReqParams immediately after a market data request is made by a user with market data subscriptions. To find a particular map of single letter codes to full exchange names, the function reqSmartComponents is invoked with the exchange mapping code returned to tickReqParams.
For instance, a market data request for the IBKR US contract may return the exchange mapping identifier "a6" to tickReqParams. Invoking the function reqSmartComponents with the symbol "a9" will reveal the list of exchanges offering market data for the IBKR US contract, and their single letter codes. The code for "ARCA" may be "P". In that case if "P" is returned to the exchange tick types, that would indicate the quote was provided by ARCA.
For samples and more information, see http://interactivebrokers.github.io/tws-api/ smart_components.html
The function IBApi::EClient::reqMatchingSymbols can be used to search for contracts based on initial letters defining the ticker symbol. For instance, if the strings "I" or "IB" are specified to search for the IB ticker symbol "IBKR" it will be returned in the list of matching contracts.
The results are returned to IBApi::EWrapper::symbolSamples.
For samples and more information, see http://interactivebrokers.github.io/tws-api/ matching_symbols.html
For stocks, there are individual exchange-specific market data subscriptions necessary to receive streaming quotes. For instance, for NYSE stocks this subscription is known as "Network A", for ARCA/AMEX stocks it is called "Network B" and for NASDAQ stocks it is "Network C". Each subscription is added a la carte and has a separate market data fee.
Alternatively, there is also a "US Securities Snapshot Bundle" subscription which does not provide streaming data but which allows for real time calculated snapshots of US market NBBO prices. By setting the fifth parameter in the function IBApi::EClient::reqMktData to True, a regulatory snapshot request can be made from the API. The returned value is a calculation of the current market state based on data from all available exchanges.
For more information on the US Reg Snapshot Market Data Service, see the IB Knowledge Base article.
Important: Each regulatory snapshot request will incur a fee of 0.01 USD to the account. This applies to both live and paper accounts. If the monthly fee for regulatory snapshots reaches the price of a particular 'Network' subscription, the user will automatically be subscribed to that Network subscription for continuous streaming quotes and charged the associated fee for that month. At the end of the month the subscription will be terminated. Each listing exchange will be capped independently and will not be combined across listing exchanges.
For samples and more information, see http://interactivebrokers.github.io/tws-api/md_request.html#regulatory_snapshot
Use with TWS version 966 or greater.
Effective with TWS version 965.1b and above, you can now receive Open Interest data for Futures via the API by sending reqMktData() and including “588” in the genericTickList parameter. Through the tickSize() callback, the futures open interest will be returned in tick type 86.
Please refer to the API Documentation for more details:https://interactivebrokers.github.io/tws-api/tick_types.html
The function IBApi::EClient::reqContractDetails can now be used to identify the following details of the underlying contract.
They are returned to IBAPI::EWrapper::contractDetails
Use the RTD Server dynamic link library to request market data from TWS via the API using an Excel spreadsheet. Enter the following formula into an Excel spreadsheet cell:
=RTD (ProgID, Server, String1, String2, ...)
For example, with the first string (String1) representing a ticker in simple syntax and String2 is the bid size:
=RTD ("Tws.TwsRtdServerCtrl", , "IBM@ISLAND", "BidSize")
The Linux/Mac C++ sample has been fixed.