开云体育

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

Re: How should one request 6-months worth of historical 1-min stock data from Interactive Brokers API?


 

开云体育

That documentation is very misleading. The crucial thing is that it says: ‘The following table exemplifies this concept’, ie the table is examples, not the only permissible possibilities.

?

The table below is a comment extracted from my code, which shows the maximum durations I use for all the various allowable bar sizes. I determined these by trial and error. I haven’t updated it for several years, and it’s certainly not entirely correct now: for example I just had 13051 1-min bars returned in a single call using a duration of 30D.

?

So I suggest you use the info below as a guide to what might be possible, but bear in mind that you may well be able to improve on this. Just try it and see!

?

?

'?? Bar Size??????? Max Duration

'?? --------??????? ------------

'

'?? 1 secs????????? 2000 S

'?? 5 secs????????? 10000 S

'?? 10 secs???????? 20000 S

'?? 15 secs???????? 30000 S

'?? 30 secs???????? 86400 S

'?? 1 min?????????? 86400 S

'?????????????????? 6 D

'?????????????????? 1 W

'?? 2 mins????????? 86400 S

'?????????????????? 10 D

'?????????????????? 2 W

'?? 3 mins????????? 86400 S

'?????????????????? 10 D

'?????????????????? 2 W

'?? 5 mins????????? 86400 S

'?????????????????? 20 D

'?????????????????? 3 W

'?? 10 mins???????? 86400 S

'?????????????????? 50 D

'?????????????????? 8 W

'?? 15 mins???????? 86400 S

'?????????????????? 50 D

'?????????????????? 10 W

'?? 20 mins???????? 86400 S

'?????????????????? 50 D

'?????????????????? 10 W

'?? 30 mins???????? 86400 S

'?????????????????? 50 D

'?????????????????? 10 W

'?????????????????? 3 M

'?????????????????? 1 Y

'?? 1 hour????????? 86400 S

'?????????????????? 50 D

'?????????????????? 10 W

'?????????????????? 3 M

'?? 2 hours???????? 86400 S

'?????????????????? 50 D

'?????????????????? 10 W

'?????????????????? 3 M

'?? 3 hours???????? 86400 S

'?????????????????? 50 D

'?????????????????? 10 W

'?????????????????? 3 M

'?? 4 hours???????? 86400 S

'?????????????????? 50 D

'?????????????????? 10 W

'?????????????????? 3 M

'?? 8 hours???????? 86400 S

'?????????????????? 50 D

'?????????????????? 10 W

'?????????????????? 3 M

'?? 1 day?????????? 86400 S

'?????????????????? 365 D

'?????????????????? 12 M

'?????????????????? 52 W

'?????????????????? 50 Y

'?? 1 W???????????? 86400 S

'?????????????????? 365 D

'?????????????????? 12 M

'?????????????????? 52 W

'?????????????????? 50 Y

'?? 1 M???????????? 86400 S

'?????????????????? 365 D

'?????????????????? 12 M

'?????????????????? 52 W

'?????????????????? 50 Y

?

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