Excel Formula Reference: Market Data

Interactive Brokers streaming live stock prices in Excel

Excel Price Feed enables you to stream live Interactive Brokers market data directly into your Excel spreadsheet via simple Excel formulas.

Please see this article on the Interactive Brokers website for details on how market data subscriptions work: https://www.interactivebrokers.com/campus/ibkr-api-page/market-data-subscriptions/#introduction

On this page:


How much live data can I stream?

All Interactive Broker clients initially receive 100 concurrent lines of real-time market data and always have a minimum of 100 lines of data.

This limit can increase based on various factors, please see this article on the Interactive Brokers website for more details: https://www.interactivebrokers.com/lib/cstools/faq/#/content/1136177958

To view the current number of market data lines that you are requesting, in TWS press CTRL + ALT + = (or CTRL + ALT + C for non-English keyboards).


Default Currency

When requesting market data for a security, it is generally necessary to specify the currency of the security. To simplify this there is a "Default Currency" setting on the Setup tab, which enables you to set a default currency which will always be used when you don't specify a currency when using one of the market data formulas:

Interactive Brokers default currency setting


Market Data Formulas

You can either enter the formula manually in your spreadsheet or use the Configuration Pane to easily insert the most common formulas into your spreadsheet.

Excel Price Feed provides many market data formulas including 3 generic formulas which can return any field and many field specific formulas:

Formula Description
EPF.IB.Stream_MarketData Stream any field for any security.
EPF.IB.Stream_MarketData_ConId Stream any field for the specified contract id.
EPF.IB.Stream_MarketData_Symbol Stream any field for the specified symbol
EPF.IB.Stream_MarketData_LastPrice_Symbol Stream Last Price for the specified symbol
EPF.IB.Stream_MarketData_LastSize_Symbol Stream Last Size for the specified symbol
EPF.IB.Stream_MarketData_BidPrice_Symbol Stream Bid Price for the specified symbol
EPF.IB.Stream_MarketData_BidSize_Symbol Stream Bid Size for the specified symbol
EPF.IB.Stream_MarketData_AskPrice_Symbol Stream Ask Price for the specified symbol
EPF.IB.Stream_MarketData_AskSize_Symbol Stream Ask Size for the specified symbol
EPF.IB.Stream_MarketData_ClosePrice_Symbol Stream Close Price for the specified symbol
EPF.IB.Stream_MarketData_DayHigh_Symbol Stream Day High for the specified symbol
EPF.IB.Stream_MarketData_DayLow_Symbol Stream Day Low for the specified symbol
EPF.IB.Stream_MarketData_LastPrice_ConId Stream Last Price for the specified contract id
EPF.IB.Stream_MarketData_LastSize_ConId Stream Last Size for the specified contract id
EPF.IB.Stream_MarketData_BidPrice_ConId Stream Bid Price for the specified contract id
EPF.IB.Stream_MarketData_BidSize_ConId Stream Bid Size for the specified contract id
EPF.IB.Stream_MarketData_AskPrice_ConId Stream Ask Price for the specified contract id
EPF.IB.Stream_MarketData_AskSize_ConId Stream Ask Size for the specified contract id
EPF.IB.Stream_MarketData_ClosePrice_ConId Stream Close Price for the specified contract id
EPF.IB.Stream_MarketData_DayHigh_ConId Stream Day High for the specified contract id
EPF.IB.Stream_MarketData_DayLow_ConId Stream Day Low for the specified contract id

EPF.IB.Stream_MarketData

=EPF.IB.Stream_MarketData(field, symbol, securityType, currency, exchange, conId, primaryExchange, lastTradeDateOrContractMonth, strike, multiplier, right, tradingClass)

This formula enables any field for any security to be streamed to an Excel cell.

The input parameters are:

Parameter Optional Description
Field No One of the available market data fields, see table below for details.
Symbol No The symbol of the security.
Security Type No The security's type, see table below for details.
Currency No The security's currency code, such as USD, EUR, JPY etc.
Exchange No The destination exchange, such as SMART, NYSE etc
Primary Exchange Yes The security's primary exchange.
Last Trade Date or Contract Month Yes The contract's last trading day or contract month (for Options and Futures). Strings with format YYYYMM will be interpreted as the Contract Month whereas YYYYMMDD will be interpreted as Last Trading Day.
Strike Yes Options only: the option's strike price.
Multiplier Yes The security's multiplier.
Right Yes Options only: "Put" or "Call" or "P" or "C"
Trading Class Yes The security's trading class name.
Examples

Stream the bid price of Apple stock:
=EPF.IB.Stream.MarketData("BidPrice","AAPL","STK","USD","SMART")

Stream the ask price of spot gold:
=EPF.IB.Stream.MarketData("AskPrice","XAUUSD","CMDTY","USD","SMART")

Stream the last price of a SPY call option for 20 June 2026 with a strike of 777:
=EPF.IB.Stream_MarketData("LastPrice","SPY","OPT","USD","SMART",,"20260612",777,,"Call")


EPF.IB.Stream_MarketData_ConId

=EPF.IB.Stream_MarketData_ConId(field, conId, exchange)

This formula is used to stream market data for a security when you know its contract id (conId). Use the contract search screen to find contracts.

Depending on the contract id, you may also need to provide the exchange. For example, the bitcoin contract is quoted on several exchanges , therefore you need to specify the exchange to avoid ambiguity, whereas ASML has different contract ids on different exchanges, therefore you don't need to specify the exchange. See the examples below.

The input parameters are:

Parameter Optional Description
Field No One of the available market data fields, see table below for details.
ConId No The contract id of the security.
Exchange Yes The destination exchange, such as SMART, NYSE etc
Examples

Stream the bid price of bitcoin on the PAXOS exchange:
=EPF.IB.Stream_MarketData_ConId("BidPrice","479624278","PAXOS")

Stream the last price of ASML stock (the EUR denominated security on Euronext Amsterdam):
=EPF.IB.Stream_MarketData_ConId("LastPrice", "117589399")


EPF.IB.Stream_MarketData_Symbol

=EPF.IB.Stream_MarketData_Symbol(field, symbol, currency, securityType, exchange)

This formula is used to stream market data for a security when you know its symbol (ticker).

Depending on the symbol, you may also need to provide the currency/securityType/exchange.

The input parameters are:

Parameter Optional Description
Field No One of the available market data fields, see table below for details.
Symbol No The symbol of the security.
Currency Yes The currency of the security.
SecurityType Yes The security type of the security.
Exchange Yes The destination exchange, such as SMART, NYSE etc
Examples

Stream the bid price of HSBC stock:
=EPF.IB.Stream_MarketData_BidPrice_Symbol("HSBA")


All Fields

This is the list of all currently available fields, we will be adding more in future releases of the Add-in.

Not all fields are available for all instruments e.g. a value for DividendDate is available for stocks but not for options.

Field names are not case sensitive and spaces between words are optional, so "BidPrice", "bid price" and "Bid Price" are all equivalent and will work.

Field Description
BidSize Number of contracts or lots offered at the bid price.
BidPrice Highest priced bid for the contract.
AskPrice Lowest price offer on the contract.
AskSize Number of contracts or lots offered at the ask price.
LastPrice Last price at which the contract traded (does not include some trades in RTVolume).
LastSize Number of contracts or lots traded at the last price.
High High price for the day.
Low Low price for the day.
Volume Trading volume for the day for the selected contract (US Stocks: multiplier 100).
ClosePrice The last available closing price for the previous day. For US Equities, we use corporate action processing to get the closing price, so the close price is adjusted to reflect forward and reverse splits and cash and stock dividends.
OpenTick Current session's opening price. Before open will refer to previous day. The official opening price requires a market data subscription to the native exchange of the instrument.
Low13Weeks Lowest price for the last 13 weeks. For stocks only.
High13Weeks Highest price for the last 13 weeks. For stocks only.
Low26Weeks Lowest price for the last 26 weeks. For stocks only.
High26Weeks Highest price for the last 26 weeks. For stocks only.
Low52Weeks Lowest price for the last 52 weeks. For stocks only.
High52Weeks Highest price for the last 52 weeks. For stocks only.
AverageVolume The average daily trading volume over 90 days. Multiplier of 100. For stocks only.
DividendPast12m The sum of dividends for the past 12 months.
DividendNext12m The sum of dividends for the next 12 months.
DividendDate The next dividend date.
DividendNext The next single dividend amount.
BidYield Implied yield of the bond if it is purchased at the current bid.
AskYield Implied yield of the bond if it is purchased at the current ask.
LastYield Implied yield of the bond if it is purchased at the last price.
DelayedBid Delayed bid price.
DelayedAsk Delayed ask price.
DelayedLast Delayed last traded price.
DelayedBidSize Delayed bid size.
DelayedAskSize Delayed ask size.
DelayedLastSize Delayed last size.
DelayedHighPrice Delayed highest price of the day.
DelayedLowPrice Delayed lowest price of the day.
DelayedVolume Delayed traded volume of the day.
DelayedClose The prior day's closing price.
DelayedBidOption Computed greeks based on delayed bid price.
DelayedAskOption Computed greeks based on delayed ask price.
DelayedLastOption Computed greeks based on delayed last price.
DelayedModelOption Computed Greeks and model's implied volatility based on delayed stock and option prices.

Security Types

These are the values that can be used for the securityType parameter:

Security Type Description
BAGCombo / spread contract
BILLTreasury bill
BONDBond
CASHForex / spot currency pair
CFDContract for Difference
CMDTYCommodity
CONTFUTContinuous future
CRYPTOCryptocurrency
EVENTEvent contract
FIXEDFixed income instrument
FOPFutures option
FUNDMutual fund
FUTFuture
FUT+CONTFUTFuture and continuous future hybrid lookup
INDIndex
IOPTIndex option
NEWSNews feed contract
OPTEquity/ETF option
SLBSecurities lending / borrow
SSFSingle stock future
STKStock / ETF
WARWarrant

Exchanges

These are the most common values that can be used for the exchange parameter:

Exchange Description
SMARTInteractive Brokers SmartRouting system
ISLANDNASDAQ (equities)
NYSENew York Stock Exchange
ARCANYSE Arca (popular for ETFs)
AMEXNYSE American
BATSCboe BZX Exchange
IEXInvestors Exchange
CMEChicago Mercantile Exchange (Futures)
CBOTChicago Board of Trade (Futures)
NYMEXNew York Mercantile Exchange (Futures)
COMEXCommodity Exchange (Futures)
CBOEChicago Board Options Exchange (Options)
BOXBoston Options Exchange (Options)
PHLXNasdaq PHLX (Options)
IBISXetra (Deutsche Borse, equities)
IBIS2Xetra ETF segment
LSELondon Stock Exchange
LSEETFLSE ETF segment
AEBEuronext Amsterdam
SBFEuronext Paris
ENEXT.BEEuronext Brussels
BVMEBorsa Italiana (Milan)
EBSSIX Swiss Exchange
EUREXEuropean Derivatives Exchange (Futures/Options)
GETTEXGettex (German retail venue)
TGATETradegate (German off-hours venue)
SEHKStock Exchange of Hong Kong
TSEJTokyo Stock Exchange
ASXAustralian Securities Exchange
NSENational Stock Exchange of India
IDEALPROInterbank spot Forex trading pairs
IBUSOPTIBKR internal options liquidity optimizer
FORECASTXEvent contracts and prediction markets
PAXOSPaxos crypto operations
ZEROHASHZero Hash crypto operations