Skip to content
All library documents

Requesting Intraday Historical Bars Through Interactive Brokers

Article Quant Q&A · Author: Viðar Ingason

Summary

The document discusses whether Interactive Brokers can provide enough historical intraday data for statistical modeling, using S&P 500 exposure as the example. It points to the R IBrokers package and its historical data request function, which can specify an instrument, bar interval, and requested duration. The example uses SPY to request 15-minute bars over one year.

A respondent says they have retrieved several years of daily OHLC data for a large stock universe and updated it periodically, but offers no direct test of the requested intraday history limits. The answer tentatively suggests that a few thousand observations may be available, while leaving the exact availability uncertain. Actual access can depend on the instrument, bar size, duration, account permissions, and broker data policies; the document does not establish a guaranteed history length or discuss data quality.

Key ideas

  • The IBrokers R package can request historical bars with a selected interval and duration.
  • The example requests one year of 15-minute SPY bars.
  • A respondent reports retrieving multi-year OHLC histories for many equities.
  • The document does not verify the exact intraday history limits for the stated account scenario.

Tags

Full text
# Interactive brokers historical data availability


# Interactive brokers historical data availability












I'm considering Interactive Brokers because of the IBrokers package for R.

On this site there is a small section on data availability and I'm having a hard time understanding the table. Lets say I have 10,000 dollars in my account and I want 15 minutes bars. Does it mean I can get few thousand observations (one year of 15 minutes bars). I'm only concerned about the S&P 500 index. I'm mainly concerned with the amount of observation since I'm building a statistical model and I want to use e.g. 15 minutes bars or even 5 minutes bars.

## Answer by Serhii Kushchenko (score 0, accepted)

https://quant.stackexchange.com/a/43889

> Does it mean I can get few thousand observations.

Probably, yes, but I did not try it myself.

Using R package IBrokers, namely, `reqHistoricalData` function, I pump out the base of several years OHLC prices for 1,700 shares, store it in MySQL, update it once a week and scan it in search of suitable purchases.

> (one year of 15 minutes bars). I'm only concerned about the S&P 500 index.

Maybe something like this:

```
test3<- twsSTK("SPY")
dat <- reqHistoricalData(tws, test3, 
                  endDateTime=paste(format(Sys.time(), "%Y%m%d %H:%M:%S")), 
                  barSize="15 min", 
                  duration="1 Y")
```

See the details here - https://stackoverflow.com/questions/26152138/ibrokers-twsfop-call-in-r?rq=1

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.