5 Second Bars
Introduction
Real time and historical data functionality is combined through the EClient.reqRealTimeBars() request. reqRealTimeBars will create an active subscription that will return a single bar in real time every five seconds that has the OHLC values over that period. reqRealTimeBars can only be used with a bar size of 5 seconds.
Request 5 Second Bars
EClient.reqRealTimeBars(tickerId, contract, barSize, whatToShow, useRTH, realTimeBarOptions)
Requests real time bars. Only 5 seconds bars are provided. This request is subject to the same pacing as any historical data request: no more than 60 API queries in more than 600 seconds.
Real time bars subscriptions are also included in the calculation of the number of Level 1 market data subscriptions allowed in an account.
Request identifier used to track data.
The Contract object for which the depth is being requested
Currently being ignored
The nature of the data being retrieved. Available Values: TRADES, MIDPOINT, BID, ASK
Set to 0 to obtain the data which was also generated outside of the Regular Trading Hours, set to 1 to obtain only the RTH data
Internal use only.
Python
Java
C++
C#
VB.NET
Receive 5 Second Bars
EWrapper.realtimeBar(reqId, time, open, high, low, close, volume, WAP, count)
Receives the real time 5 second bars.
Request identifier used to track data.
The bar’s start date and time (Epoch/Unix time)
The bar’s open point
The bar’s high point
The bar’s low point
The bar’s closing point
The bar’s traded volume (only returned for TRADES data)
The bar’s Weighted Average Price rounded to minimum increment (only available for TRADES).
The number of trades during the bar’s timespan (only available for TRADES).
Python
Java
C++
C#
VB.NET
Cancel 5 Second Bars
EClient.cancelRealTimeBars(tickerId)
Cancels Real Time Bars’ subscription.
Request identifier used to track data.

