Datasets

Interactive Brokers

Introduction

Interactive Brokers (IB) was founded by Thomas Peterffy in 1993 with the goal to "create technology to provide liquidity on better terms. Compete on price, speed, size, diversity of global products and advanced trading tools". IB provides access to trading Equities, ETFs, Options, Futures, Future Options, Forex, CFDs, Gold, Warrants, Bonds, and Mutual Funds for clients in over 200 countries and territories with no minimum deposit. IB also provides paper trading, a trading platform, and educational services.

The Interactive Brokers (IB) data provider serves asset prices from IB's Trader Workstation API. This page explains our integration with their data API and its functionality.

Sourcing

The IB data provider sources data directly from IB's Trader Workstation API. If you use this data provider, IB only provides the security price data. QuantConnect Cloud provides the auxiliary datasets.

Bar Building

The data is a summarized snapshot of the trades and quotes at roughly 300 milliseconds per snapshot.

Hybrid Data Provider

When you deploy a live algorithm with the IB brokerage, you can use the QuantConnect data provider, the IB data provider, or both. If you use multiple data providers, the order you select them in defines their order of precedence in Lean, so Lean only uses a provider for the securities that the providers before it don't supply. If you use a third-party data provider, the assets that you subscribe to don't contribute to the IB data limit.

We suggest the following configurations, in order of preference:

  1. The QuantConnect data provider on its own. It's free and it's high quality, and it covers most asset classes.
  2. The QuantConnect data provider first and a provider that fills its gaps second. The QuantConnect data provider doesn't supply Index data (for example, SPX, VIX, and NDX) or Future Options data, so you need this configuration to trade Index Options, which need the underlying index, and to trade Future Options.
  3. The IB data provider first and the QuantConnect data provider last. Use this configuration if you want to trade on IB prices and let the QuantConnect data provider cover the rest.

Alternative Data

Third-party data providers support most alternative datasets, except data that streams real-time intraday data. If you're using streaming datasets, like the Tiingo News Feed and Benzinga News Feed, include the QuantConnect data provider as an additional data provider. The hybrid QuantConnect-IB data provider supports streaming datasets.

Historical Data

If you get historical data from IB through a history request or a warm-up period, the historical data has the following characteristics:

  • Second resolution data is limited to six months of history.
  • The historical data excludes delisted Equities and expired Options.
  • The historical data excludes expired Futures after two years.

The following quotas are in place for tick and second resolution historical data:

  • You can have up to 50 simultaneous requests.
  • You can make up to 60 requests within any 10-minute period.

In the preceding quotas, TradeBar and QuoteBar data count as separate requests. For example, if you request TradeBar and QuoteBar data for SPY, it counts as two requests.

For more information about historical data from IB, see Historical Data Limitations in the IB documentation.

Pricing

To use IB data in your algorithms, subscribe to IB market data. We support all of the IB data subscriptions that are related to the securities and markets we support. Members usually subscribe to the following IB market data:

  • US Securities Snapshot and Futures Value Bundle
  • US Equity and Options Add-On Streaming Bundle
  • CFE Enhanced Top of Book (L1 for VIX Futures)
  • CME S&P Indexes (L1 for SPX and NDX)
  • CBOE Streaming Market Indexes (L1 for VIX Index)

The IB data provider can stream data for up to 100 assets by default, but IB may let you stream more than 100 assets based on your commissions and equity value. For more information about quotas from IB, see the Market Data Pricing Overview page on the IB website. If your algorithm adds more than the your quota, LEAN logs an error message from IB. To increase the quota, purchase a Quote Booster from IB.

To see the latest prices, check the Market Data Pricing Overview page on the IB website. IB can take up to 24 hours to process subscription requests. So after you subscribe to data, you need to wait 24 hours before you can use it in your algorithms. When you subscribe to data, IB only assigns your data subscription to one of your accounts. If you want to assign the subscription to a different account, then contact IB.

If you want to use IB market data and trade with your paper trading account, follow these steps:

  1. Log in to the IB Client Portal.
  2. In the top-right corner, click the person icon and then click Settings.
  3. In the Account Configuration section, click Paper Trading Account.
  4. Click Yes.
  5. Click Save.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: