¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Can't query historical futures data


 

i am currently using the following contract-information.


contract.symbol("MYM");
contract.secType("FUT");
contract.currency("USD");
contract.exchange("CBOT");
contract.lastTradeDateOrContractMonth("202303");
contract.includeExpired(true);
"Historical Market Data Service error message:HMDS query returned no data: MYM? MAR 23@CBOT Trades" this is the error i receive when trying to fetch the historical futures data.?


 

You should show the whole query you used for your historical request.

Because the message , while labeled like an error, is explicit and say "no data" , i.e. that there is nothing to show for the contract you ask in the period you ask using the query options you did set.


 

i am able to get the data by changing the bar size and duration, currently 1-year and 1-day barsize. what is the least possible barsize for historical data of futures ??


 

¿ªÔÆÌåÓý

1 second is the shortest barsize. Here¡¯s the data leading up to 16:00 on 17 Feb:

?

?

?

?

From: [email protected] <[email protected]> On Behalf Of ram.bharadwaj.arya@...
Sent: 20 February 2023 16:00
To: [email protected]
Subject: Re: [TWS API] Can't query historical futures data

?

i am able to get the data by changing the bar size and duration, currently 1-year and 1-day barsize. what is the least possible barsize for historical data of futures ??


 

This is not a question of Bar size, it is a question of whether or not there was at least one transaction during the period you query.

The bigger is the Bar, the more chance something did happen during Bar Time, also the longer the period? the more chance too.
But when I say "chance", it means that 'no data' is a valid answer, regardless of the Barsize, and you should be able to handle it, as saying there was no transaction to report.

As Richard show it, even using 1Second Bar if you query from 2023-02-17 15:59:15 to 2023-02-17 15:59:29 in 1Sec bar you will get 'no data' as there was no transaction.

Believe IB: if they say 'no data' it means no data to report as per your query.