Connect Interactive Brokers With MarketXLS

MarketXLS and Interactive Brokers integration

Introduction

Interactive Brokers LLC operates the largest electronic trading platform by number of daily average revenue trades in the U.S. It brokers and connects to any electronic exchange globally, enabling investors to trade stocks, options, futures, EFPs, futures options, forex, bonds, and funds.

Interactive Brokers is well known for its wealth of tools for sophisticated investors interested in tracking global investing trends. They mainly cater to institutional investors and sophisticated, active traders around the globe, providing a wide range of offerings and staying on top of market conditions to achieve optimal execution.

The Interactive Broker Trade Station (TWS)

Everything about Interactive Brokers centers around Traders Workstation (TWS). TWS is a powerful and extensively customizable downloadable platform. It provides solid fundamental research and excellent charts with a comprehensive suite of indicators.

Once you're in TWS, Interactive Brokers' trading experience stands out among all brokers. It lets you set order defaults for every possible asset class, define hotkeys for rapid order transmission, stage orders for later execution (individually or in batches), and schedule orders with specific dates and times. There are practically unlimited ways an order can be entered.

Integration Walkthrough

Prerequisites

Steps 1-3 are only necessary if you don't already have TWS running.
1

Install Interactive Brokers Trader Workstation (TWS)

Make sure the desktop version of TWS is fully installed (not web-based):

https://www.interactivebrokers.com/en/index.php?f=16042
Interactive Brokers Trader Workstation download
2

Install TWS API

Download and install the TWS API:

TWS API Install 976.01.msi
TWS API configuration settings
3

Configure API Settings

After installing TWS API:

  1. Open the TWS application
  2. Go to Global Configuration → API → Settings
  3. Make sure ActiveX and Socket Clients checkbox is enabled
  4. Verify Socket port is set to 7496
  5. Click OK to save
4

Launch TWS and Excel

  1. Open Interactive Brokers TWS and keep it running
  2. Open Excel and start using MarketXLS
  3. Functions are pre-loaded - type =ib in a cell to see the functions list
Interactive Brokers functions in Excel

Reference Spreadsheet

Check out this example spreadsheet showing Interactive Brokers functions in action: View Example Spreadsheet