Historical Time & Sales
Introduction
The highest granularity of historical data from Interactive Brokers can be retrieved using the API function EClient.reqHistoricalTicks for historical time and sales values. Historical Time & Sales will return the same data as what is available in Trader Workstation under the Time and Sales window. This is a series of ticks indicating each trade based on the requested values.
- Historical Tick-By-Tick data is not available for combos.
- Historical tick data is only available for the last 3 years.
- Data will not be returned from multiple trading sessions in a single request; Multiple requests must be used.
- To complete a full second, more ticks may be returned than requested.
- Time & Sales data requires a Level 1, Top Of Book market data subscription.
Halted and Unhalted Ticks
- If tick has zero price, zero size and pastLimit flag is set – this is “Halted” tick.
- If tick has zero price, zero size and followed immediately after “Halted” tick – this is “Unhalted” tick.
Request Historical Ticks
EClient.reqHistoricalTicks(requestId, contract, startDateTime, endDateTime, numberOfTicks, whatToShow, useRth, ignoreSize, miscOptions)
Requests historical Time & Sales data for an instrument.
id of the request
Contract object that is subject of query.
i.e. “20170701 12:01:00”. Uses TWS timezone specified at login.
i.e. “20170701 13:01:00”. In TWS timezone. Exactly one of startDateTime or endDateTime must be defined.
Number of distinct data points. Max is 1000 per request.
("Bid_Ask", "Midpoint", or "Trades") Type of data requested.
Data from regular trading hours (1), or all available hours (0).
Omit updates that reflect only changes in size, and not price. Applicable to Bid_Ask data requests. Note: Options and Future Options will only display a value of 1, unless to indicate a removed bid/ask, which will instead return a price and size value of 0.
Should be defined as null; reserved for internal use.
Python
Java
C++
C#
VB.NET
Receive Historical Ticks
Data is returned to unique functions based on what is requested in the whatToShow field.
- EWrapper.historicalTicks() for
whatToShow=MIDPOINT - EWrapper.historicalTicksBidAsk() for
whatToShow=BID_ASK - EWrapper.historicalTicksLast() for for
whatToShow=TRADES
EWrapper.HistoricalTicks
EWrapper.historicalTicks(reqId, ticks, done)
For whatToShow=MIDPOINT
id of the request
object containing a list of tick values for the requested timeframe.
return whether or not this is the end of the historical ticks requested.
Python
Java
C++
C#
VB.NET
EWrapper.HistoricalTicksBidAsk
EWrapper.historicalTicksBidAsk(reqId, ticks, done)
For whatToShow=BidAsk
id of the request
object containing a list of tick values for the requested timeframe.
return whether or not this is the end of the historical ticks requested.
Python
Java
C++
C#
VB.NET
EWrapper.HistoricalTicksLast
EWrapper.historicalTicksLast(reqId, ticks, done)
For whatToShow=Last & AllLast
id of the request
object containing a list of tick values for the requested timeframe.
return whether or not this is the end of the historical ticks requested.

