Set up your IBKR Flex Query for FolioTracking

Tested configuration · Activity Flex Query · XML

A Flex Query is a reusable Interactive Brokers report definition. FolioTracking uses its positions, trades and cash records to populate your portfolio; missing sections mean missing history.

Create and connect your query

  1. Open Flex Queries. Sign in to IBKR Client Portal. Choose Performance & Reports → Flex Queries and select the intended account.
  2. Create the query. Click + beside Activity Flex Query, then enter a recognizable name. Use Activity Flex Query, not Trade Confirmation.
  3. Tick Sections. Select every section in the table below. Within Account Information, select only Currency. Leave personal fields—name, address, date of birth, email and phone—unticked. Keep the financial fields needed for dates, symbols, quantities, amounts, trade identifiers and realized results in the other sections.
  4. Set Delivery Configuration. Apply the exact settings below. Leave the Symbols filter empty so holdings and option contracts are not accidentally excluded. Click Continue, review the configuration, then Create.
  5. Copy the Query ID. Return to the query list and open its information icon to find the Query ID. Keep it private.
  6. Enable the service. Open Flex Web Service Configuration, enable the service, save, and generate a token. Note its expiry. Generating a new token invalidates the old one; update any connection using it.
  7. Connect in FolioTracking. Open Broker connections, choose the intended portfolio, and enter its Query ID and Flex Token, plus expiry if known. After syncing, check the report period and several holdings against IBKR.

Recommended settings for FolioTracking

Settings tested with real IBKR syncs
SettingValue / purpose
Sections to tickAccount Information (Currency only); Cash Report; Cash Transactions; Change in Dividend Accruals; Corporate Actions; Net Asset Value (NAV) in Base; Open Positions; Option Exercises, Assignments and Expirations; Trades.
FormatXML
PeriodLast 365 Calendar Days
Date FormatyyyyMMdd
Time FormatHHmmss
Date/Time Separator; (semi-colon)
Profit and LossDefault
Include Offsetting Trade/Cancel PairsNo
Include Currency RatesNo
Include Audit Trail FieldsNo
Display Account Alias in Place of Account IDNo
Breakout by DayNo
Symbols filterLeave empty

Why these sections? Account Information supplies the base currency, not personal identity. Cash Report supplies balances; Cash Transactions supplies dividends, deposits, withdrawals, fees and taxes. Change in Dividend Accruals provides per-share dividend-rate evidence; Corporate Actions provides split evidence. NAV in Base provides dated values supporting the starting value and Contributions chart. Open Positions supplies current holdings; Trades supplies executions and realized results. Option Exercises, Assignments and Expirations supplies option lifecycle events.

The parser uses only currency (or Currency) from Account Information. Account type and personal fields are not required. NAV coverage and an explicit opening balance are different: if no suitable starting value is supplied, review or enter one rather than inventing it. The rolling 365-day period is not lifetime history.

Security and timing

Never share your token or Query ID publicly, in screenshots or support messages. If you restrict the token by IP, the requesting server must be allowed. Today's trades may appear only after IBKR's overnight statement run; if IBKR is busy, wait rather than repeatedly syncing.

See IBKR's official Activity Flex Query instructions and Flex Web Service instructions. Then explore options tracking or dividend tracking. FolioTracking is independent software, not an IBKR service.

Open FolioTracking

Free public beta. Informational tracking, not investment advice. Verify figures with your broker.