Skip to main content
mykola://brokers/interactive-brokers

Interactive Brokers

Overview

Interactive Brokers (IBKR) is a global broker covering stocks, options, and futures across every major exchange. Mykola supports IBKR via both Auto Sync (the recommended path — credentials saved once, fills pulled on a schedule) and File Upload (CSV export from IBKR's Flex Web Service).

Supported markets

Stocks · Options · Futures

How to import

Auto Sync (recommended)

IBKR's Flex Web Service mints a long-lived token paired with a saved Flex Query ID. Mykola uses that token to pull a fresh activity statement on every sync tick.

One-time setup in IBKR:

  1. Sign in to Client Portal at https://www.interactivebrokers.com/.
  2. Go to Performance & Reports → Flex Queries (or Reports → Flex Queries in the older portal).
  3. Click Create under Activity Flex Query. Give it a name like Mykola Trades.
  4. Add the Trades and Cash Transactions sections.
    • In Trades, include columns: DateTime, Symbol, AssetClass, BuySell, Quantity, TradePrice, IBCommission, Multiplier, Conid.
    • In Cash Transactions, include Date, Amount, Type.
  5. Set Period to Last 365 calendar days (or longer) and Format to CSV.
  6. Save the query and note its Query ID (a numeric string).
  7. Go to Settings → Account Settings → Flex Web Service and enable it. IBKR will show your Token (a long hex string). Copy it.

In Mykola:

  1. Open Accounts → Add a broker account.
  2. Pick Interactive Brokers, name the account, paste the Flex Query ID and the Flex Token.
  3. Hit Add account. The next scheduler tick pulls your fills; the account page shows the last sync time.

File Upload

If you'd rather not store a token, you can do the same Flex query manually and upload the resulting CSV:

  1. From the Flex Queries page, click Run on the query.
  2. Download the CSV.
  3. In Mykola: Accounts → your Manual account → Import CSV, pick the Interactive Brokers preset, upload the file.

Troubleshooting

  • "Could not authenticate with Flex" — Flex tokens expire if not used for a long stretch. Re-generate one from Settings → Flex Web Service and update the account.
  • Missing options multiplier — make sure the Multiplier column is included in your Flex query's Trades section. Without it, options notional/ROI math is wrong by 100×.
  • Account just created and no trades yet — IBKR's Flex Web Service requires the account to be at least 24 hours old before queries return data.

More info

See Interactive Brokers' Flex Web Service documentation.