← All guides

Interactive Brokers

How to export an Activity Flex Query in XML format

Taxify reads an Activity Flex Query in XML format. You set up the Flex Query one time, then you use it to download any period. Do the steps exactly: if a section or a field is missing, the import runs, but the calculation can be incomplete.

1Create the Flex Query

Log in to Client Portal at Interactive Brokers.

  1. 1.Go to Performance & Reports.
  2. 2.Click Flex Queries.
  3. 3.If you have more than one account, select the account whose statement you want to create. Each account needs its own Flex Query. If you have only one account, continue with point 4.
  4. 4.In the Activity Flex Query part, click the + icon ("Create").
The Performance & Reports menu in Client Portal with the Flex Queries item

Swipe the screenshot to the side, or tap it to make it larger.

2Enter the name and enable the required sections

A form opens, in which you enter the data. In the Sections part, enable exactly these 9 sections.

  1. 1.Enter the Query Name, for example "Taxify - export".
  2. 2.Click the name of a section. A window with its settings opens. For each section, do as its description below says.
  3. 3.If the window has an Options part, tick in it only what the description of the section below says.
  4. 4.Tick Select All. This selects all fields of the section.
  5. 5.Click Save.
The list of the Activity Flex Query sections with 9 sections enabled

Swipe the screenshot to the side, or tap it to make it larger.

Account Information

The data of the account. Taxify reads only the days on which the account opened, got its first money and closed, so that it does not ask IBKR for days on which the account did not exist. It does not need the name, the address or other personal data.

  • Fields: tick these 3 dates: Date Opened, Date Funded and Date Closed. You can also tick Select All.
The settings of the Account Information section in Interactive Brokers

Cash Transactions

Dividends, withholding tax, interest and coupons. IB has no separate "Dividends" or "Withholding Tax" section – these are transaction types in this section.

  • Options: tick all transaction types and Detail. Leave Summary empty.
  • Fields: tick Select All.
The settings of the Cash Transactions section in Interactive Brokers

Corporate Actions

Splits, mergers and other events that change the number of shares or the acquisition price.

  • Options: tick only Detail.
  • Fields: tick Select All.
The settings of the Corporate Actions section in Interactive Brokers

Financial Instrument Information

The table of the instruments (ISIN, asset class, multiplier). With it, Taxify identifies for example ETFs and options.

  • Fields: tick Select All.
The settings of the Financial Instrument Information section in Interactive Brokers

Open Positions

The positions at the end of the period, with the date and the price of each buy.

  • Options: tick only Lot.
  • Fields: tick Select All.
The settings of the Open Positions section in Interactive Brokers

Option Exercises, Assignments and Expirations

The exercises, assignments and expirations of options.

  • Fields: tick Select All.
The settings of the Option Exercises, Assignments and Expirations section in Interactive Brokers

Prior Period Positions

The positions during the period, day by day.

  • Fields: tick Select All.
The settings of the Prior Period Positions section in Interactive Brokers

Trades

All buys and sells – the base of the calculation.

  • Options: tick only Execution. Leave the other options empty – if not, the trades occur more than one time in the file.
  • Fields: tick Select All.
The settings of the Trades section in Interactive Brokers

Transfers

Moves of positions and cash between IB accounts, for example when you changed your account. The option Lot adds the original purchases of each position that moved, with their dates and prices – Taxify uses them for the cost and for the time test.

  • Options: tick Transfer and Lot.
  • Fields: tick Select All.
The settings of the Transfers section in Interactive Brokers

3Check the settings

Set these values in Delivery Configuration and General Configuration. Most of them are correct by default. Then save the Flex Query.

Format
XML
Date Format
yyyyMMdd
Time Format
HHmmss
Date/Time Separator
; (semi-colon)
Profit and Loss
Default
Include Offsetting Trade/Cancel Pairs?
No
Include Currency Rates?
No
Include Audit Trail Fields?
No
Display Account Alias in Place of Account ID?
No
Breakout by Day?
No
The Delivery Configuration and General Configuration settings in Interactive Brokers

Swipe the screenshot to the side, or tap it to make it larger.

4Run the Flex Query

  1. 1.Go to Performance & Reports. If you have more than one account, first select the account whose statement you want to download.
  2. 2.Click the Flex Queries tab.
  3. 3.In the Activity Flex Query part, find the query that you created, "Taxify - export".
  4. 4.Click the arrow (Run) on the right.
The Flex Queries list with the query "Taxify - export" and the arrow that runs it

Swipe the screenshot to the side, or tap it to make it larger.

5Set the period and download the statement

  1. 1.In the Period field, select Custom Date Range. In "From Date", enter 1 January of the year (or the date when you opened the account). In "To Date", enter 31 December of the same year.
  2. 2.Keep XML in "Format".
  3. 3.Click Run. Save the XML file. Do this again for each year of the account – one file for each year.
The window that runs the query, with the period Custom Date Range and the format XML
Interactive Brokers lets you download a maximum of 365 days at a time, so you need one file for each year. Upload all years to Taxify, not only the year of your tax return: a sell in 2025 is FIFO-matched with a buy that can be from 2021.

6Upload the statement to Taxify

  1. 1.In Taxify, open Accounts and select your broker account. If you do not have one yet, create it.
  2. 2.On the Import trades tab, drop the files into the marked area or select them with the button. Upload every year.
  3. 3.When the processing is complete, you see the imported trades and you can start the tax calculation.

Tips

  • Periods that overlap are not a problem: Taxify finds duplicate trades and skips them.
  • If a sell has no matching buy, import the earlier years.
  • Taxify reads only a Flex Query in XML format. It does not support an Activity Statement in CSV yet.
  • You can enter trades from platforms that Taxify does not import yet by hand, in the account detail.

Problems with the export?

Write to us and we help you with the specific step.

Contact support