Receiving Historical Bars
EWrapper.historicalData (
reqId: int. Request identifier used to track data.
bar: Bar. The OHLC historical data Bar. The time zone of the bar is the time zone chosen on the TWS login screen. Smallest bar size is 1 second.
)
The historical data will be delivered via the EWrapper.historicalData method in the form of candlesticks. The time zone of returned bars is the time zone chosen in TWS on the login screen.
Python
Java
C++
C#
VB.NET
Default Return Format
The text on the right is the default formatting for returning data.
The datetime value here was [modified to return UTC datetime](/tws-api/doc/market-data-historical/historical-date-formatting/introduction) formatting.
Note: The datetime value indicates the beginning of the request range rather than the end. The last bar on the right would then indicate data that took place between 20241111-16:53:15 to 20241111-16:53:20.
Text
Python
Java
C++
C#
VB.NET
EWrapper.historicalDataUpdate (
reqId: int. Request identifier used to track data.
bar: Bar. The OHLC historical data Bar. The time zone of the bar is the time zone chosen on the TWS login screen. Smallest bar size is 1 second.
)
Receives bars in real time if keepUpToDate is set as True in reqHistoricalData. Similar to realTimeBars function, except returned data is a composite of historical data and real time data that is equivalent to TWS chart functionality to keep charts up to date. Returned bars are successfully updated using real time data.
Python
Java
C++
C#
VB.NET
EWrapper.historicalDataEnd (
reqId: int. Request identifier used to track data.
start: String. Returns the starting time of the first historical data bar.
end: String. Returns the end time of the last historical data bar.
)
Marks the ending of the historical bars reception.

