Interactive Brokers
Interactive Brokers broker connection
$49.95 / Lifetime OR included in Premium subscription
Try before you Buy! Download the Extension for a 14-day free trial before purchasing.
(all Extensions require a Wealth-Lab Subscription)

Interactive Brokers

Interactive Brokers live trading and data interface

  • Connect to IB TWS or the IB Gateway
  • Automated strategy trading
  • Order types: Market, Limit, Stop, StopLimit, Market On Close, and Limit On Close
  • Historical and Streaming data using your IB Data Subscriptions for quotes, charts, and Strategy Monitor

Requirements

One-Time Setup Instructions

It's required that you are logged in and running IB TWS or the IB Gateway to connect with IB. To make the connection you must perform this one-time setup:

Step 1 - Configure IB TWS
Enable the following settings in the TWS Configuration > API > Settings:

  • [x] Enable ActiveX and Socket Clients - checked
  • Socket Port - default is 7496. You only need to change this number for additional instances of TWS. Wealth-Lab will connect to only one instance at a time.
  • [ ] Use Account Groups with Allocation Methods - unchecked (if you have multiple linked accounts).
  • [ ] Allow conections from localhost only - to connect to TWS running on a different virtual machine or network uncheck this and enter the Trusted IP. For example, if you're using the Mac version of TWS, open your Mac's Network app and enter the IP for the wireless/cabled connection here, e.g., 192.168.1.10.

Optional setting in TWS Configuration > API > Precautions

  • [x] Bypass Order Precautions for API Orders - check this option if you don't want orders from Wealth-Lab to be delayed or canceled due to exceeding a size limit or another precaution.

Step 2 - Configure Interactive Brokers in Wealth-Lab
Configure the Wealth-Lab connection settings for IB in the Data Manager > Historical (or Streaming) Provider tab or use the Order Manager > Interactive Brokers > Configure. Specify the following:

  • Host IP Address - default: 127.0.0.1. Alternatively, enter the IP address you configured in TWS if not the localhost.
  • Port - default: 7496. Use the Socket Port configured in TWS.
  • Client ID - default: 1. No need to change this unless you have multiple data clients that are connecting to the same instance of TWS. Enter 0 (zero) if you wish to retrieve manual orders from TWS upon connection.
  • Delayed Data - check this only if you're evaluating TWS with delayed data.
  • Auto Launch IB TWS - check to allow Wealth-Lab to automatically launch IB TWS when 1) IB TWS or Gateway is not detected to be running locally and IB connection is required for data or trading.
  • Option Chart WhatToRequest - Trades provides a chart based on option trading, whereas MidPoint provides a chart of the Bid/Ask MidPoint throughout the day. Because option trading most often is illiquid, when developing strategies that do not rely on contract trade volume, MidPoint is recommended. It's not currently possible to see both Trades and MidPoint, so you must decide which data you wish to retain.

DISCLAIMER:

The third party data is subject to the availability of the respective provider (website) and may be delayed or inaccessible periodically due to network or technical reasons. As the data is not guaranteed to be accurate, it is your responsibility to confirm that it does not contain errors before utilizing it for any type of backtesting or trading activities. Quantacula LLC is not to be held liable for any errors in market data or its inavailability.

Screenshots

Streaming Charts
Drive your realtime trading using your IB data subscriptions
Historical Data
Create and Update DataSets using IB data subscriptions
Automated Trading
Manually Stage and Place orders, or just let Wealth-Lab trade your strategies automatically!
Quote Monitor
Monitor and trigger your end-of-day orders using the Quotes tool
Connection Settings
Connect to TWS or the IB Gateway after a quick one-time set up

Change Log

Wealth-Lab 8 Build 14 - 9/14/2022
  • Manage individual AccountUpdatesMulti subscriptions
  • Messaging to troubleshoot duplicate OrderId
Wealth-Lab 8 Build 13 - 9/12/2022
  • Revert to reqPositions to subscribe to position updates for all accessible accounts
  • Show Cash Balances in multiple currencies
  • Added a few Log Viewer messages to aid troubleshoot linked accounts
Wealth-Lab 8 Build 12 - 9/10/2022
  • Fixed base symbol for AUD currency futures in IBFutures.txt
  • Fixed contract symbol returned to the Broker Account for Euro futures and contracts whose last trade date is before the front month. (e.g., CL contracts)
  • Fixed Accounts tool's Basis Price value for futures
  • New! n-Second interval support for 10, 15, and 30-Second bars (only). "Faster" intervals return too many bars for our 1-day increment requests.
  • Change! If trading futures using 1-digit year symbols (e.g., ESU2), you must now map these to the 2-digit year symbol for IB in the Order Manager mapping, e.g., ESU2=ESU22. This is required to synchronize Position exits because Order Manager will now always return the 2-digit year symbol format.
Wealth-Lab 8 Build 11 - 9/1/2022
  • Avoid missing order status updates for new orders after a reconnect if IB doesn't send the openOrderEnd callback.
  • Avoid unnecessary requests for expired contracts less than 2 years expired.
  • Fix symbol used in request cache for futures and options.
  • Skip historical requests for expired option contracts and futures more than 2 years expired.
Wealth-Lab 8 Build 10 - 8/17/2022
  • Automatic lookup for EUREX Market. If you trade instruments on EUREX, you may need to create a Market named "EUREX".
Wealth-Lab 8 Build 9 - 8/4/2022
  • StopLimit Order Type support added (Build 13 required).
  • Adapt change from DTB to EUREX exchange for some Euro futures.
Wealth-Lab 8 Build 8 - 6/27/2022
  • Data Providers are now more careful about checking Offline Mode before making web requests (requires WL8 Build 10+).
  • Updated API to 10.16. No notable API changes, only internal compatibility.
  • Fix: Stop orders for Futures were not triggering outside of regular market hours. "Outside RTH" will always be set true for FUT and CASH stop orders.
  • Fix: SymbolInfo for CASH contracts.
Wealth-Lab 8 Build 7 - 6/14/2022
  • Support for Pre/Post Market orders.
  • Fixed a "light-weight" request that wasn't returning an account's buying power.
  • New IB Configuration option to return Bid/Ask Midpoint in charts instead of Trades data. Options are most often illiquid contracts, and pricing can move significantly from the last-traded price during the day. Midpoint provides Bid/Ask Midpoint OHLC bars continuously throughout the day, which should be more accurate pricing for backtesting.
  • SymbolInfo for BarHistories will automatically "load" with the contract details. In most cases it won't be required to make entries for new IB contracts in Markets & Symbols.
Wealth-Lab 8 Build 6 - 5/26/2022
  • Resolved some issues around latency in IB Account updates.
  • Fix for KeyNotFoundException when using Streaming Bars
Wealth-Lab 8 Build 5 - 5/13/2022
  • Quick failure return when requesting a contract without data permissions. Previously, requesting a contract without data permissions would "spin" many unnecessary requests.
  • Handle TWS not installed at c:\jts, or, just TWS not installed.
  • Fix - Cash and Cryptos contracts were defaulting to STK types in Accounts.
Wealth-Lab 8 Build 4 - 5/2/2022
  • Fixed some data issues for customers with non-USD regional settings.
Wealth-Lab 8 Build 3 - 4/21/2022
  • Adaptation for new LimitClose Order Type, and IB supports LOC orders if enabled in Trading Preferences.
Wealth-Lab 8 Build 2 - 4/14/2022
  • Futures and Options - symbol matching and basis price adjustment.
Wealth-Lab 8 Build 1 - 4/10/2022
  • Initial WL8 release.
Wealth-Lab 7 Build 20 - 3/2/2022
  • Change: STP LMT orders entered in IB TWS will now appear as Stop instead of Limit orders in Wealth-Lab. (Note: To get open orders entered manually in TWS, you must use Client ID 0 in the IB Configuration.)
  • Minor code optimization for streaming.
Wealth-Lab 7 Build 19 - 2/7/2022
  • New: Option to enable/disable auto launching TWS
  • Change: If a symbol record doesn't exist in Markets & Symbols, IB Build 19+ will assign the market using the contract's exchange for all security types (not just futures). If a Market doesn't already exist for a symbol's exchange, you should create one.
  • Change: Automatic assignments for the major markets listed in Markets and Symbols are now assigned based on the contract exchange. For example, "Hong Kong Stock Exchange" Market for symbols with contract exchanges HKFE and SEHK; "Brazil Bovespa" for BOVESPA, "Frankfurt Stock Exchange" for IBIS and FWB, etc.
  • Internal change: The TWS Time Zone and offsets are calculated in a different way. You shouldn't notice a difference, and charts should continue to display data in the assigned Market's time zone.
  • Fix: Don't update a streaming bar with zero volume except for Cash and Index contracts that don't return volume.
  • Fix: prefix and extra day for intraday requests for contracts that trade through midnight so that data isn't skipped.
  • Work continues to reconnect after a TWS restart. Currently, following a TWS restart, you need to re-initiate the connection in the normal ways (Order Manager Connect button, request chart data, etc.)
Wealth-Lab 7 Build 18 - 1/28/2022

New!

  • We recommend using Streaming Bars in the Strategy Monitor for Interactive Brokers Streaming. Streaming Bars create a real time replica of intraday historical bars with at least 10 times less processing required than Streaming. (Streaming chart data often results in minor differences from historical bar data because the "ticks" are conflated and updated no faster than 4 times per second.)

Change:

  • Enabled connecting to a network machine by attempting a connection before checking if TWS or IB Gateway is running locally. TWS or IB Gateway must already be running on the other machine and you must ensure your firewall is configured correctly.

Fixes:

  • IB configuration is loaded after a restart
  • Load zero volume bars for index (IND) contracts (streaming and historical providers). Initially, you should request data for index contracts using the explicit specification, e.g., SPX;IND;USD;CBOE to create the contract reference. Thereafter you can just use the symbol, e.g., SPX. See Help > Interactive Brokers for more examples.
  • 100x volume multiple is for US stocks only. Previously, volume was multiplied by 100 for any instrument assigned to the default U.S. Market, not just STK security types.
  • Fix for parameter changes not always sticking.
Wealth-Lab 7 Build 17 - 1/19/2022

Fixes

  • Correctly identify option contracts with decimal strikes
  • Fix streaming volume for non-stock contracts

Changes

  • Calculate midpoint for streaming forex charts. Previously, streaming charts were updated with bid prices only.
  • Ignore streaming subscribe requests for expired futures or options contracts
  • Change IB's heartbeat symbol to BTC.USD for more coverage. EUR.USD will be used on Fridays since Forex closes 1 hour later than PAXOS.
Wealth-Lab 7 Build 16 - 1/10/2022

IB Data Provider "Overhaul" with breaking changes.

You must upgrade to TWS Latest version 10.12+ to use Build 16.

Fixes and other changes

  • Corrected removal of a bar from the end of each historical batch request made during market hours.
  • Trade volume will be far more accurate for streaming charts.
  • Corrected volume for non-U.S. stocks in historical charts. You should refresh non-U.S. stock charts to correct the cache for 100x volume
  • Ignore zero-volume bars in historical data for non-CASH contracts
  • Ignore Closing data returned with negative or zero values; adjust OHL appropriately for neg/zero values.
  • Consolidated the "Market data farms OK" messages to a single log message.

New!

  • Wealth-Lab will display batch request messages in the Chart Status Bar when making multiple requests for data. We recommend that you limit intraday chart requests by setting a small range (e.g. 2000 bars) in Data Preferences.
  • A SecurityName will be displayed for new chart requests. You may need to reload older charts to retrieve the name.

Crypto Support

Added data and trading (beta) support for cryptos: BTC.USD, BCH.USD, ETH.USD, LTC.USD

  • Trading Cryptos has not been tested with Build 16.
  • Extra data permissions are not required for cryptos, but you must upgrade to the TWS Latest v10.12 to access them.

U.S. Options

  • Simplified specification of U.S. option contracts to this format: [Symbol][yyMMdd][C/P][Strike]. e.g, for ATVI's June 17, 2022 67.5 Call, enter: ATVI220617C67.5

U.S. and Euro Futures

  • Major upgrade to simplify futures contract specification. An IBFutures.txt file will be loaded in the User data directory that contains many U.S. and European futures contract specifications. When a contract is defined in IBFutures.txt, you only need to type a futures symbol with the symbol-month-year format. e.g. ESH2 or ESH22.

  • The first time you make a data request for a non-expired futures contract, the Provider will add a record to IBFutureSymbolSpecs.txt in the User data directory. This file contains future specs (margin, point value, min tick, etc.) that can be pasted in Symbols.txt. Futures margin is based on exchange requirements for Initial Margin in December 2021.

  • Data request dates are automatically controlled for expired futures contracts.

  • Added support for continuous contracts. Instead of a letter month and year, use #C, e.g., ES#C, CL#C, GC#C, etc. -- Note! Do not use Continuous Contracts for trading.

  • Let us know if you trade non-U.S. options in the Discussion forum!

Wealth-Lab 7 Build 15 - 12/21/2021
  • Added an IB-specific Parser for the Trade History Strategy type.
  • Changes to adapt to WL7 framework changes in Build 42.
Wealth-Lab 7 Build 14 - 12/7/2021
  • Fixed order status updates not ocurring issue.
Wealth-Lab 7 Build 13 - 12/3/2021
  • Avoid requesting entire intraday history when a Max Bars Data Range is selected.
Wealth-Lab 7 Build 12 - 11/30/2021
  • Minor changes to take advantage of better data loading mechanisms in WL7 Build 37.
  • Beefed up error handling and logging.
Wealth-Lab 7 Build 11 - 11/26/2021
  • When active OCO orders are reloaded, they will show OCO link icon.
Wealth-Lab 7 Build 10 - 11/22/2021
  • Extend end date requests one day into the future to account for different time zones.
  • Active orders will now populate into the Order Manager when IB Broker is connected.
Wealth-Lab 7 Build 9 - 11/12/2021
  • Provider marked as not supporting parallel updates.
Wealth-Lab 7 Build 8 - 10/21/2021
  • The VIX futures contract wouldn't come back before. It's required to specify the IB Local Symbol for futures contracts if it's different than the IB Symbol, in this case, VIX and VX.
  • Improve performance when canceling Data Requests.
Wealth-Lab 7 Build 7 - 9/20/2021
  • Connecting will now launch TWS if TWS or IB Gateway is not already open.
Wealth-Lab 7 Build 6 - 9/3/2021
  • Support for native OCO (One-Cancels-Other) orders.
  • Support for MOO (Market on Open) orders.
Wealth-Lab 7 Build 5 - 8/19/2021
  • Update for new Accounts framework, display accounts and positions info in Accounts window.
Wealth-Lab 7 Build 4 - 6/12/2021
  • Fixed bug preventing short orders from being placed.
Wealth-Lab 7 Build 3 - 3/30/2021
  • Fixed historical requests for Forex data.
  • Refer to Help > Extension > Interactive Brokers for guidance on entering symbols/contracts.
Wealth-Lab 7 Build 2 - 3/17/2021
  • Fix: multiple simultaneously placed orders were failing for duplicate order IDs.
  • Integrate help topic: Extensions > Interactive Brokers.
Wealth-Lab 7 Build 1 - 3/9/2021
  • Baseline release.

Discussions