Interactive Brokers Excel API

Published: 8 Feb 2023

This page is an overview of the three ways to connect Interactive Brokers data to Excel, comparing their strentghs and weaknesses, which is suitable for what, and basic guidance.

IB Excel API options

There are three different options for connecting Interactive Brokers to Excel:

At the moment (February 2023), all three require Excel for Windows (they do not work in Excel for Mac) and support both 32 bit and 64 bit systems.

Each has strengths and limitations (see official comparison table), so each is suitable for different purposes.

RTD Server

RTD (which stands for Real-Time Data) is best for getting real-time quotes from IB into Excel. It uses the RTD Excel function, which is very simple and flexible. For example, this formula gets the continuously updated last price of the Apple stock:

=RTD("Tws.TwsRtdServerCtrl",,"AAPL","Last")

RTD is also the most lightweight of the three options – it does not put too much strain on Excel performance and does not require VBA. If you only need live quotes, use RTD.

See a 3-step setup guide at Macroption:

Interactive Brokers Quotes in Excel, Made Simple – Macroption

See also full official documentation from IB.

That said, RTD does not support other features, such as accessing your account and positions. So if you need something other than real-time quotes, you need one of the other two options.

DDE Socket Bridge

DDE stands for Dynamic Data Exchange. Like RTD, it is not a technology specific to IB Excel API – it is commonly used for communication between different applications in the Windows environment.

Unlike RTD, DDE can get both real-time and historical data from IB into Excel.

The downside is greater demand for configuration and performance. For example, your Excel must use the US number format (comma as thousands separator, dot as decimal separator). Sometimes DDE can get very slow or hang if there are other application using DDE open at the same time (according to IB, applications including Google Chrome, OneNote, or Skype may cause these issues at times).

Compared to RTD, which is really simple, DDE is considerably most complicated to work with.

See official docs from IB.

Bottom line: If you only need real-time data and have no specific reason to use DDE, it is better to use RTD. However, if you also want to download IB historical data into Excel, use DDE.

ActiveX

The ActiveX option offers the full range of features and is the most flexible of the three, but it also the most complicated to use.

For RTD and DDE, it is enough if you have experience with spreadsheets and writing Excel functions. For ActiveX you will need developer level experience – and if you have that, you may want to consider using some of the other Interactive Brokers APIs, such as C# or Python.

See official docs from IB.

By remaining on this website or using its content, you confirm that you have read and agree with the Terms of Use Agreement.

We are not liable for any damages resulting from using this website. Any information may be inaccurate or incomplete. See full Limitation of Liability.

Content may include affiliate links, which means we may earn commission if you buy on the linked website. See full Affiliate and Referral Disclosure.

We use cookies and similar technology to improve user experience and analyze traffic. See full Cookie Policy.

See also Privacy Policy on how we collect and handle user data.

© 2024 FinTut