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 field | IBKR name | What it looks like |
|---|---|---|
| Flex Token | Flex Web Service token | a long number, ~20 digits |
| Flex Query ID | Activity Flex Query ID | a 6–8 digit number, e.g. 1449203 |
Auto Sync (recommended)
1 — Get your Flex Token
- Log in to the IBKR Client Portal on a desktop browser.
- Open Performance & Reports → Flex Queries.
- Next to Flex Web Service Configuration, click the gear (settings) icon.
- In the dialog, set Flex Web Service Status to active and choose an activation period of one year.
- Click Generate New Flex Token, then Save.
- 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.
- On the Flex Queries page, click the + next to Activity Flex Query to start a new query.
- Set a Query Name (e.g.
Mykola) and, under Sections, open Trades. - In Trades, choose Executions, then Select All. Scroll to the bottom and Save.
- Under Delivery Configuration, set the Format to CSV and enable column headers.
- 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.
- Under General Configuration, set exactly:
- Date Format →
yyyy-MM-dd - Time Format →
HH:mm:ss - Date/Time Separator → a single space (
)
- Date Format →
- Click Continue → Create, and confirm.
- Reopen the query with the info (ⓘ) icon and copy its Query ID — this is your Flex Query ID.
3 — Connect in Mykola
- Go to Accounts → Add a broker account and choose Interactive Brokers.
- 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
- In the Client Portal, open Performance & Reports → Flex Queries.
- Click the + next to Trade Confirmation Flex Query.
- Name it (e.g.
Mykola), open Trade Confirmation under Sections, choose Executions → Select All, and Save. - Under General Configuration, use the same settings as above:
- Date Format →
yyyy-MM-dd - Time Format →
HH:mm:ss - Date/Time Separator → a single space (
)
- Date Format →
- Click Continue → Create, and confirm.
2 — Run it and download the CSV
- Back on the Flex Queries page, click the Run (▸) icon next to your query.
- 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
- Go to Accounts → your Manual account → Import CSV.
- 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 FormatHH: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.