Skip to main content
Integration

Interactive Brokers

Overview

Connecting Interactive Brokers (IBKR) to Mykola is a one-time setup. Once it's done, Mykola imports your trades for the date range you choose and then keeps pulling new fills automatically, once a day.

There are two ways to connect:

  • Auto Sync (recommended) — save two read-only credentials once and Mykola fetches your activity on a schedule. No passwords, no trading access.
  • File Upload — export a CSV from IBKR by hand and upload it. Best if you'd rather not store a token, or you need data in right now.

Note: same-day trades can take a little while to appear — IBKR's Flex service usually publishes them within 24 hours. If you need a trade reflected immediately, use File Upload.

What you'll need

Two values from IBKR, both pasted into Mykola:

Mykola fieldIBKR nameWhat it looks like
Flex TokenFlex Web Service tokena long number, ~20 digits
Flex Query IDActivity Flex Query IDa 6–8 digit number, e.g. 1449203

Auto Sync (recommended)

1 — Get your Flex Token

  1. Log in to the IBKR Client Portal on a desktop browser.
  2. Open Performance & Reports → Flex Queries.
  3. Next to Flex Web Service Configuration, click the gear (settings) icon.
  4. In the dialog, set Flex Web Service Status to active and choose an activation period of one year.
  5. Click Generate New Flex Token, then Save.
  6. Copy the token — this is your Flex Token.

2 — Create an Activity Flex Query

This is the report Mykola reads, and it gives you the Flex Query ID.

  1. On the Flex Queries page, click the next to Activity Flex Query to start a new query.
  2. Set a Query Name (e.g. Mykola) and, under Sections, open Trades.
  3. In Trades, choose Executions, then Select All. Scroll to the bottom and Save.
  4. Under Delivery Configuration, set the Format to CSV and enable column headers.
  5. Pick the Period you want to import — Last 365 Calendar Days is a good default. If you have more than one account, select the account this query covers.
  6. Under General Configuration, set exactly:
    • Date Formatyyyy-MM-dd
    • Time FormatHH:mm:ss
    • Date/Time Separator → a single space ( )
  7. Click Continue → Create, and confirm.
  8. Reopen the query with the info (ⓘ) icon and copy its Query ID — this is your Flex Query ID.

3 — Connect in Mykola

  1. Go to Accounts → Add a broker account and choose Interactive Brokers.
  2. Name the account (e.g. IBKR main), paste your Flex Query ID and Flex Token, and click Add account.

Mykola syncs the account on the next tick; the account's row shows the last sync time once it completes.

File Upload

Prefer not to store a token? Export the CSV yourself and upload it.

1 — Create a Trade Confirmation Flex Query

  1. In the Client Portal, open Performance & Reports → Flex Queries.
  2. Click the next to Trade Confirmation Flex Query.
  3. Name it (e.g. Mykola), open Trade Confirmation under Sections, choose Executions → Select All, and Save.
  4. Under General Configuration, use the same settings as above:
    • Date Formatyyyy-MM-dd
    • Time FormatHH:mm:ss
    • Date/Time Separator → a single space ( )
  5. Click Continue → Create, and confirm.

2 — Run it and download the CSV

  1. Back on the Flex Queries page, click the Run (▸) icon next to your query.
  2. Choose the date range (e.g. Last 365 Calendar Days), set the format to CSV, and Run. A CSV downloads to your computer.

3 — Upload to Mykola

  1. Go to Accounts → your Manual account → Import CSV.
  2. Choose the Interactive Brokers preset and upload the file. Mykola takes care of the rest.

For future imports, just re-run the query for the new date range and upload the fresh CSV.

Troubleshooting

  • "Could not authenticate with Flex" — the token expired or was regenerated. Open Flex Web Service, copy the current token, and update it on the account's Credentials → Edit form.
  • No trades after connecting — IBKR needs at least one day-old trade before the Flex service returns data, and a brand-new account must be ~24 hours old. Also confirm the query Period covers the dates you traded.
  • Invalid date/time on import — the General Configuration wasn't set. Reopen the query and confirm Date Format yyyy-MM-dd, Time Format HH:mm:ss, and a single-space Date/Time Separator, then re-run.
  • Options P&L looks 100× off — add the Multiplier field to the query's Trades section; Mykola needs it to size options notional and ROI correctly.