Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

potential missing history #48

Open
mhyatt000 opened this issue Feb 10, 2025 · 3 comments
Open

potential missing history #48

mhyatt000 opened this issue Feb 10, 2025 · 3 comments

Comments

@mhyatt000
Copy link

Thanks for all your hard work- the library is amazing!

Not sure where to ask this question since it might be a limitation of the REST API, but I thought there might be some answers / similar experience from ibind users.

I've noticed that some of the historical options data does not go back as far as I'd expect. For example, I search for the calls with ITM/ATM strikes (2027 JAN LEAPS) and do not get data from before 2024 december 03.

I use history = self.client.marketdata_history_by_conids(...)
corresponding to the return self.get('iserver/marketdata/history', params) API call.

This is true for all the symbols not just google, but here is example after post processing

2024-12-03  GOOGL     C   135.0  56.00 2026-12-18     0.0
2024-12-04  GOOGL     C   135.0  56.00 2026-12-18     0.0
2024-12-05  GOOGL     C   135.0  56.00 2026-12-18     0.0
2024-12-06  GOOGL     C   135.0  56.00 2026-12-18     0.0
...
2025-02-03  GOOGL     C   135.0  81.69 2026-12-18     4.0
2025-02-04  GOOGL     C   135.0  83.39 2026-12-18     0.0
2025-02-05  GOOGL     C   135.0  85.50 2026-12-18     0.0

for SPX 2029 C ATM I cannot see history before dec 10 this year

2024-12-10    SPX     C  6100.0  1467.6 2029-12-20     0.0
...
2025-02-03    SPX     C  6100.0  1491.3 2029-12-20     0.0

I thought there ought to be API history from much earlier for these and even owned some of positions before december. Any thoughts would be much appreciated.

@Voyz
Copy link
Owner

Voyz commented Feb 11, 2025

hey @mhyatt000 thanks for the detailed issue and for your kind words!

As for the question - I think this is something you should discuss with IBKR support. They're pretty responsive if you drop them a message through the Web Portal.

I can share that I also saw some stock contracts returning shorter amount of historical data than available elsewhere. I understand that different data vendors provide different availability, although your case seems to be particularly short so I'd definitely bring this up with IBKR. If you do, let us know what they say 👍

@Lamassucoding
Copy link

just curious, where are we with this issue?
I'm facing same issue, where I request data for the past 5 days 1 minute and get back less than 2 days back

history = client.marketdata_history_by_symbols('AAPL', period='5d', bar='1min', outside_rth=True)

0 240.57 240.71 240.42 240.48 1159.14 2025-02-26 15:51:00
1 240.48 240.56 240.37 240.51 643.55 2025-02-26 15:52:00
2 240.52 240.63 240.30 240.38 752.17 2025-02-26 15:53:00
3 240.39 240.81 240.29 240.48 1699.07 2025-02-26 15:54:00
4 240.49 240.69 240.38 240.41 1312.36 2025-02-26 15:55:00
.. ... ... ... ... ... ...
995 237.19 237.22 237.13 237.22 5.21 2025-02-27 16:26:00
996 237.23 237.43 237.23 237.43 4.89 2025-02-27 16:27:00
997 237.43 237.43 237.43 237.43 0.00 2025-02-27 16:28:00
998 237.25 237.25 237.06 237.06 13.83 2025-02-27 16:29:00
999 237.06 237.06 237.06 237.06 0.00 2025-02-27 16:30:00

anyone see this issue?
my guess it doesn't return more than 999 candle at a time.....Am I right?
thx

@salsasepp
Copy link

anyone see this issue? my guess it doesn't return more than 999 candle at a time.....Am I right? thx

You may be correct.

This /iserver/marketdata/history only provides up to 1000 data points.

At least that is what the Web API 1.0 docs states, not sure the same applies for the newer Web API. See https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/#hist-md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants