An Interactive Brokers portfolio tracker takes the raw record IBKR keeps of your account — every trade, dividend and tax deduction — and turns it into the answers a long-term investor actually wants: how the portfolio has done against the market, how much risk it carried, and where the return came from. The cleanest way to feed one is a Flex Query read through IBKR’s Flex Web Service, which is read-only by design. This guide covers why the statements alone are hard work, what a tracker should get right, and how the connection is set up.
Interactive Brokers’ reporting is thorough, and that is the point of it. A broker serving active traders, professionals and accountants in many markets has to record everything: each execution of an order, each currency conversion, each commission and fee, each dividend with its withholding tax on a separate line, each corporate action. A statement built for completeness is exactly what a tax return or an audit needs.
It is not what a long-term investor needs on a Sunday evening. The questions are simpler and the statement does not answer them directly: am I beating an index fund? how deep was the worst fall? which three holdings made most of the money? are my positions really different bets? Getting there from a statement means exporting, cleaning and re-adding lines in a spreadsheet — and doing it again next quarter.
A short checklist, whichever tool you use:
Lemma Analysis connects Interactive Brokers through two values from Client Portal: a Flex Web Service token and a Flex Query ID. The query is a report template you build once; the token lets our servers ask IBKR to run it. Neither can trade. In outline:
The connect dialog in the app spells out every section, option and field to tick, in the words Client Portal prints beside them, and a query missing a required section or field is refused by name when you connect. The token is stored encrypted, never shown again, and deleted when you disconnect; the transactions it imported stay. More on what we hold is on the security page.
One limit is worth knowing before you start. A Flex Query reaches back at most 365 days, and the Flex Web Service takes no dates from the caller, so a connection can never read further back than the period of your query. Trades from earlier years will not arrive by themselves.
They can still come in, as files. Export an Activity Statement as CSV from Client Portal for each earlier year and load it through the import wizard, which recognises the Interactive Brokers (Activity Statement) format; the CSV import guide walks through it. Keep those files to the years before the connection’s window: a file row is matched against what is already there by its details rather than by IBKR’s own ids, so the connection should own the most recent year.
A Flex token lives as long as you chose when you generated it, and nothing reports that date afterwards — not the statement, not an error, until the day it stops working. So the connect dialog asks for the Token expiry. With a date recorded, the connection shows it calmly, switches to a Key expires soon chip thirty days before, and to Key expired after the day. Renewing is the same errand each time: generate a new token in Client Portal, then disconnect the account and connect it again.
Once connected, the account syncs itself every night, and the row counts down to the next sync. Run now starts one at once, but it rarely helps on the day of a trade: a broker’s statement is written after the market closes, so a trade made today arrives in the sync after that. If IBKR rejects the token the row says Key rejected and stops; if a run fails for any other reason it says Sync failed and the token is still good.
The transactions land in a portfolio of your choice, and the portfolio tracker does the bookkeeping: holdings with average cost and profit, a money-weighted XIRR, upcoming dividends, drift against your sector targets, and each position’s contribution to return. The portfolio analytics board then answers the investor’s questions from the first section:
Why the board’s return and XIRR can differ for the same year is explained in time-weighted vs money-weighted return.
Broker connections, the import wizard and the analytics board are part of the Ultimate plan, and every new account gets Ultimate for seven days once its email address is confirmed, with no card — enough to connect IBKR and see the board on your own history. The connection lives in Settings → Connected accounts (step by step in the broker connection guide), beside Trading 212, the other broker that can be connected; Revolut, Degiro, XTB and Freedom24 come in through a file instead. On the free plan you can still track a portfolio by entering transactions yourself, within the free plan’s limits.
Educational only. Not investment advice.
Lemma Analysis gives independent investors both lenses in one terminal — a stock screener and an intrinsic value tool for the fundamentals, alongside price history and charts for timing.