Interactive Brokers

Sync stocks, options, futures and forex from Interactive Brokers through a read-only Flex Web Service token and a Trade Confirmation Flex Query.

New and not yet tested against a live IBKR account. If something looks wrong, tell us with Support in the Settings menu on the left.

Steps

  1. 1Sign in to IBKR Client Portal. Open Menu → Reporting → Flex Queries (older screens: Performance & Reports or Statements & Reporting → Flex Queries).
  2. 2Click the gear icon next to Flex Web Service Configuration and switch the service on. A token appears.
  3. 3Generate the token you will use. Under "Should Expire After" pick the longest period offered: IBKR's default is 6 hours, and when the token expires the sync stops until you create a new one. Leave the IP address blank (a token locked to an IP address cannot be used by our sync service). Click Generate New Token and copy it. Generating a new token invalidates the previous one.
  4. 4In Flex Queries, find the Trade Confirmation Flex Query Templates section and click the + icon. Name the query, for example Tradeopath.
  5. 5Under Sections, open the section that lists your executions (Trade Confirmation). Set the level of detail to Executions, then tick these fields: Account ID, Symbol, Asset Class, Currency, Buy/Sell, Quantity, Price, Multiplier, Date/Time, Trade ID, Commission, Commission Currency. Order ID and Exec ID are optional. Save the section.
  6. 6Under Date Configuration choose Format XML and a Period of Last 30 Calendar Days (so a few days offline never loses a fill).
  7. 7Under General Configuration choose the date format yyyyMMdd or yyyy-MM-dd and any time format with a date/time separator. Leave "include canceled trades" off. Click Continue, then Create.
  8. 8Click the info icon beside the new query and copy its Query ID.
  9. 9Optional, for older history: create an Activity Flex Query the same way with a Trades section (level of detail Executions, same fields) and a longer period such as Last 365 Calendar Days. Copy its Query ID too.
  10. 10In Tradeopath open Connections, click Add connection and pick Interactive Brokers. Paste the token and the Query ID (and the Activity query ID if you made one). Choose the time zone your statements use, then Connect.
  11. 11Your IBKR account numbers appear in your journal by themselves within a few minutes. The dashboard then asks once what kind of account each one is (personal, prop or demo).

Good to know

  • The token is read-only reporting access. It can only fetch the reports you defined; it cannot trade, move money or change settings.
  • Sync is near real time through trade confirmations, but IBKR can take several minutes to publish a fill, and Tradeopath checks every 5 minutes. Trades can therefore show up about 5 to 15 minutes late.
  • If the token expires, the connection shows an error saying so. Create a new token in Client Portal, then disconnect and connect again.
  • IBKR allows one request per second and 10 per minute per token. Tradeopath stays under both. Do not use the same token in other tools at the same time.
  • Profit is calculated from your fills (price difference times quantity times the Multiplier from your statement), in the currency of the instrument. The commission is the one on your statement, in its own currency. Amounts are not converted between currencies.
  • Bonds, bills and combination (BAG) orders are skipped. Option expirations and assignments are not part of trade confirmations, so an option held to expiry stays open in the journal. Cancelled trades are skipped and are not undone if they were imported earlier.
  • A trade that appears in both queries is counted once (IBKR's Trade ID is the identity).
  • Flex statement times carry no time zone. If trade times look shifted, disconnect and connect again with the right zone, and delete the mis-timed trades first because the same trade is not imported twice.
  • Use one source per account. Importing the same IBKR trades from a CSV file as well can count them twice.

Back to the help center