|
|
This documentation is now deprecated. Please switch to the IBKR Campus for up-to-date information regarding IBKR's API solutions. |
The maximum number of simultaneous open historical data requests from the API is 50. In practice, it will probably be more efficient to have a much smaller number of requests pending at a time.
Although Interactive Brokers offers our clients high quality market data, IB is not a specialised market data provider and as such it is forced to put in place restrictions to limit traffic which is not directly associated to trading. A Pacing Violation1 occurs whenever one or more of the following restrictions is not observed:
Note that when BID_ASK historical data is requested, each request is counted twice. In a nutshell, the information above can simply be put as "do not request too much data too quick".
Important: the above limitations apply to all our clients and it is not possible to overcome them. If your trading strategy's market data requirements are not met by our market data services please consider contacting a specialised provider.
A step size is defined as the ratio between the historical data request's duration period and its granularity (i.e. bar size). Historical Data requests need to be assembled in such a way that only a few thousand bars are returned at a time. The following table exemplifies this concept:
Duration | Allowed Bar Sizes |
---|---|
60 S | 1 sec - 1 mins |
120 S | 1 sec - 2 mins |
1800 S (30 mins) | 1 sec - 30 mins |
3600 S (1 hr) | 5 secs - 1 hr |
14400 S (4hr) | 10 secs - 3 hrs |
28800 S (8 hrs) | 30 secs - 8 hrs |
1 D | 1 min - 1 day |
2 D | 2 mins - 1 day |
1 W | 3 mins - 1 week |
1 M | 30 mins - 1 month |
1 Y | 1 day - 1 month |
The other historical data limitations listed are general limitations for all trading platforms:
Note:
1. At this time Historical Data Limitations for barSize = "1 mins" and greater have been lifted. However, please use caution when requesting large amounts of historical data or sending historical data requests too frequently. Though IB has lifted the "hard" limit, we still implement a "soft" slow to load-balance client requests vs. server response. Requesting too much historical data can lead to throttling and eventual disconnect of the API client. If a request requires more than several minutes to return data, it would be best to cancel the request using the IBApi.EClient.cancelHistoricalData function.