Brokerage Data Feeds

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, 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 feed streams live asset prices from IB. If you use this data feed and request historical data, the historical data comes from IB.

Sourcing

The IB data feed comes directly from IB. For more information about the data source, see the Trader Workstation API documentation.

If you use the IB data feed, IB only provides the security price data. We provide the following auxiliary datasets from the Dataset Market:

Universe Selection

Universe selection is available with the IB data feed.

AddUniverse(CoarseUniverseSelection, FineUniverseSelection);
self.AddUniverse(self.CoarseUniverseSelection, self.FineUniverseSelection)

The universe selection data comes from our Dataset Market, not the TWS market scanners. Universe selection with the IB data feed occurs around 6-7 AM Eastern Time (ET) on Tuesday to Friday and at 2 AM ET on Sunday. Universe selection data isn't available when the IB servers are closed. To check the IB server status, see the Current System Status page on the IB website.

The IB data feed 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 data feed limits from IB, see the Market Data Pricing Overview page on the IB website. If your algorithm adds more than the your limit, LEAN logs the following message:

Error - Code: 101 - Max number of tickers has been reached - The current number of active market data subscriptions in TWS and the API altogether has been exceeded (102). This number is calculated based on a formula which is based on the equity, commissions, and quote booster packs in an account.

where 102 is the number of the subscription LEAN tried to add when it received the error message.

Bar Building

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

Alternative Data

Brokerage data feeds support most alternative data feeds, except feeds that stream real-time intraday data. Streaming data feeds, like the Tiingo News Feed and Benzinga News Feed, require the QuantConnect data feed. The hybrid QuantConnect-IB data feed supports streaming data feeds.

Hybrid QuantConnect Data Feed

When you deploy a live algorithm with the IB brokerage, you can use the QC data feed, the IB data feed, or both. If you use both data feeds, Lean gives priority to the QuantConnect data feed. If our data feed doesn't have a stream for the securities you request, Lean uses the IB data feed. This process makes it possible to use our data feed for Equity universe selection and then place Options trades on the securities in the universe. If you use the QC data feed, the assets that you subscribe to don't contribute to the IB data feed limit.

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 feeds 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)

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, for example, a paper trading account instead of a live trading account, then contact IB.

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: