According to the Interactive Brokers TWS API documentation on "Requesting Historical Bar Data":
keepUpToDate, Whether a subscription is made to return updates of unfinished real time bars as they are available (True), or all data is returned on a one-time basis (False). Available starting with API v973.03+ and TWS v965+. If True, and endDateTime cannot be specified.
I don't understand exactly what this means. Logically, I had assumed that this function would start a "5 Second Real Time Bars" subscription and close the "Historical Bar Data" subscription after historical bars were sent to the present.
However, this is not what happens. The post "Historical Bar Data" messages received appear randomly, sometimes a couple of seconds apart, sometimes milliseconds apart. The messages almost appear to be Ticks, except that most of these "Ticks" have identical price data.
I think I know what is going here or at least an example that might make sense to folks also trying to figure this out.
Have a look:
The yellow price slider on the Y-Axis moves up and down in sync with the last candle, which mutates with the "live" last price until the candle fully closes and the next one starts. The price updates of the last unfinished candle appear to match the HistoricalDataUpdateMessage data almost exactly.
I have handled the HistoricalDataUpdateMessage to produce similar action as what is seen on the TWS chart for my chart. The results are nearly identical.