¿ªÔÆÌåÓý

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

Can not get more historical data.


 

I found that I only can get the historical data from 2009/05/13 to now from 'ISLAND'. And there is more data from 'CBOE', around 2004. How to get more historical data?
Here is my code:

Stock_name = "TLT"
mycontract = Contract()
mycontract.symbol = Stock_name
mycontract.secType = "STK"
mycontract.exchange = "ISLAND"
mycontract.currency = "USD"
self.reqHistoricalData(orderId, mycontract, "20230802 16:00:00 US/Eastern", "25 Y", "1 Day", "TRADES", 0, 1, 0, [])
--
QX


[Moderator edit: Removed unrelated code]


 

I don't see a way to do it because if you call HeadTimeStamp for TLT you will get: Wednesday, May 13, 2009 11:00:00 AM

This say that there is no data available before this date and show that what you got is relevant with this information.
I am not sure I understand what you mean by "And there is more data from 'CBOE', around 2004." ?


 

Sure, thanks!
I mean I got the earliest available data point of SPX from CBOE is 20040304.
--
_QX


 

You are requesting data for Nasdaq only ("ISLAND") and that's probably what you get. I say "probably" because meaningful historical data are not easy to get from IBKR, at least?in terms of specifying what exactly is?required. Equities frequently change symbols and move between exchanges, and to add insult to injury perform all sorts of mergers, splits and spin-offs. Data providers need do some stock forensics to keep track of all of this so as to get all the different varieties of adjusted current data, including gluing together data from different exchanges and for different symbols, all referring to the same stock. I'm not sure IBKR is very good at this.

TLT is likely no stranger to such disruption as Blackrock moved a lot of their iShares ETF's between ARCA, BATS and NMS in the previous decade. Therefore it is completely credible that there must be no Nasdaq (NMS) data for this stock between its inception date in 2002 and some more recent date in the past.

Unfortunately it doesn't get much easier from here. Generally I would suggest just using "SMART" for the exchange so that the API aggregates data from all exchanges for the equity in question. This seems to work with TLT but only partially. Indeed, with SMART we get 5 times as much volume as with ISLAND supporting the suggestion that this time it's data collected from many more venues than just NMS. However the historical period now is even shorter - we only get data from 2016 and later.

I have no sensible interpretation for this other that 2016 was yet another of those years when some significant event took place in the history of this equity and IBKR probably messed up its aggregation. Usually I believe SMART should naturally yield both the biggest volume and the longest historical period.

FWIW I managed experimentally to get data right from the very inception of TLT in 2002 using exchange="ARCA". I guess that was the original exchange where TLT started to trade. But even though this data is available for the whole lifespan of TLT from 2022 right to 2023, the volume is again much smaller than with SMART (when it's available) since, naturally, we only get data for a single trading venue rather than the whole market, and one that has not even been primary for some years now, suggesting that the critical EOD prices in this period may not precisely match the official consolidated tape closing prints widely used for daily price tracking.