开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Spotty historical bars for TICK-AMEX and other indexes


 

Has anyone else experienced day-long gaps in these type of indexes when requesting historical bars from IB API?? For example, I get no data back for September 3rd, 2021 for TICK-AMEX, but I get it for September 2.

Thanks


 

Can you be a little more specific? What bar size, duration, and duration unit are you using? And how do you specify the end time (time, time zone)?

Just ran a quick test for 20210901, 20210902, and 20210903 and got all the data to be expected:

  • With duration "1 day" and useRTH = false in the Chicago Time Zone
  • Data was returned for 06:00 through 19:00 Chicago time (13 hours)
  • Received 9,360 bars of 5 second bars per day
  • Received 780 bars of 1min per day

闯ü谤驳别苍


 

Thank you.? I am using:

endDateTime =?"2021-09-03"
durationString = "1 D"
barSizeSetting = "1 min"
whatToShow = "TRADES"
useRTH = 1
formatDate = 1
keepUpToDate = False
chartOptions = []

I believe it is the New York time zone.? Maybe it is useRTH or whatToShow.? Are you pulling TRADES?

Thanks


 

Actually the exact string for endDateTime is?"20210903 23:59:59" with no timezone specified.


 

That should work, according to the documentation. At least if your TWS is using a US time zone.

Why don't you try "20210904 00:00:00 US/Eastern", that we use:

  • We found that 00:00:00 on the day following the end date works more reliably than 23:59:59 on end date.
  • We found that it is more convenient and more reliable when the instrument's native time zone is appended (from the contract object). That reduces confusion especially when the "end of day" is involved and works well regardless of the of TWS time zone.
  • And finally, we use dateFormat = 2 to be independent from the TWS time zone. That way you get a time stamp in seconds (which is always in GMT by definition) instead of a structured date/time format.

The value of useRTH makes no difference for TICK-AMEX since the contract indicates the exact same time frames of 06:00 through 20:00 Eastern for tradingHours and liquidHours.

闯ü谤驳别苍


On Tue, Sep 7, 2021 at 01:24 PM, <nshale2@...> wrote:
Actually the exact string for endDateTime is?"20210903 23:59:59" with no timezone specified.


 

Thank you, it was actually a bug in my program.? I'll stick to that request format though.??