开云体育

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

Re: reqHistoricalData - volume returned as 0.0


 
Edited

It looks like your contract object relates to NQU2 futures but on 20220401, NQM2 is still the front future. I just repeated your query and while NQM2 does have trades in pretty much every second in the 1/2 before market open on 20220401, NQU2 (which you are requesting had only very few trades the entire day and non just before market open. Therefore, volume = 0 and count = 0 values are correct.

As a matter of practice, we never create contract objects ourselves. We rather make a reqContraclDetails query (in this case NQM2:FUTURE:GLOBEX or NQU2:FUTURE:GLOBEX if that is what you really want) and use the returned contract object for calls such as reqHistoricalData. This also has the advantage that you do receive trading hour details for the next few days as well as the native time zone for the instrument. That is "US/Central" in this case.

You will get the most stable results if you specify times in the native timezone of the instrument since you do not have to deal with any complex timezone math. And if you are located outside of the US where your daylight saving times do not line up with those in the US (or in Arizona, where daylight saving is not observed, except in the north eastern part in the Navajo Nation) you can get your head spinning in no time and you will make mistakes. Consequently, we would have specified '20220401 08:30:00 US/Central'.

The long form timezone identifiers are much less error prone and IBKR has switched over to them pretty much everywhere. You can find a complete list in the

闯ü谤驳别苍


On Thu, Jul 7, 2022 at 05:46 PM, <shriki36@...> wrote:

Hey,

I am trying to pull out some historical data about NQ Future.?

The time frame is 1 sec for the last 30 min (for example) - The thing is that the volume is always returned as 0.0 which is doesn't make sense.

Example:??

ib.reqHistoricalData(contract, endDateTime='20220401 09:30:00 est', barSizeSetting='1 secs',
durationStr='1800 S', whatToShow='TRADES', useRTH=False, formatDate=2)

where contract is:?

contract = Future('NQ', '202209', 'GLOBEX', '', '20', 'USD') 

Does anyone faced with this issue??

Another thing is the timezone which I need to understand how to make it aligned with the trading hours.?

?

Thanks for the help :)?


?On Thu, Jul 7, 2022 at 05:46 PM, <shriki36@...> wrote:
reqHistoricalData

Join [email protected] to automatically receive all group messages.