🍪 Cookie Settings

    We use cookies and similar technologies. Necessary cookies are required for the site to function. Analytics cookies (Google Analytics) help us understand usage. Marketing cookies (Google Ads) enable personalized advertising and performance measurement. Privacy Policy

    Self-service tool · No tax advisory/ case review · Results may vary – please verify

    IBKR Ă— Flex-Query Export

    XML Flex Query Export Guide

    Step-by-step guide to creating and exporting XML data files from Interactive Brokers, LYNX, CapTrader, etc.

    1

    Log in

    2

    Navigate

    3

    Create

    4

    Configure

    5

    Export

    1

    Log into Client Portal

    Log into the Client Portal of Interactive Brokers, LYNX or CapTrader.

    2

    Navigate to Flex Queries

    In the Client Portal, click Performance & Reports → Flex Queries .

    Navigate to Flex Queries in Interactive Brokers Client Portal
    Navigate to Flex Queries in Client Portal
    3

    Create Flex Query

    Click + to create a new Flex Query.

    Create new Flex Query with plus button
    Create new Flex Query
    4

    Configure Flex Query

    Assign Query Name

    Assign a query name, e.g. tax_export

    Select Sections

    Select the following sections with the specified options. For each section: Select all details via "Select All", then click Save .

    Cash Report> Options: Currency Breakout

    Configuration Cash Report
    Configuration: Cash Report
    Grant Activity

    Configuration Grant Activity
    Configuration: Grant Activity
    Statement of Funds> Options: Currency Breakout

    Configuration Statement of Funds
    Configuration: Statement of Funds
    Corporate Actions> Options: Detail

    Configuration Corporate Actions
    Configuration: Corporate Actions
    Open Positions> Options: Summary

    Configuration Open Positions
    Configuration: Open Positions
    Trades> Options: Execution

    Configuration Trades
    Configuration: Trades
    Transfers> Options: Transfer

    Configuration Transfers
    Configuration: Transfers

    Delivery Configuration

    Accounts:Select all relevant accounts
    Models:Optional
    Format:XML
    Period:Last Business Dday
    Delivery configuration with XML format
    Delivery configuration with XML format

    General Configuration

    Date Format:yyyyMMdd
    Time Format:HHmmss
    Date/Time Separator:; (semi-colon)
    Profit and Loss:Default
    Include Canceled Trades?:No
    Include Currency Rates?:No
    Display Account Alias in Place of Account ID?:No
    Breakout by Day?:No
    General configuration with date format and other settings
    General configuration

    Finish

    Click Continue, then Create and confirm with Ok.

    Flex Query successfully created - confirmation screen
    Flex Query successfully created
    5

    Start XML Export

    Click the Play icon to start the Flex Query.

    Click play button to start Flex Query
    Play button to start the Flex Query

    Export Settings

    Period:Custom Date Range
    From / To:Relevant period (max. 365 days)
    Format:XML
    Export dialog with period selection and XML format
    Export dialog with period selection

    Important Note

    XML Flex Query exports are limited to a time window of one year. Therefore, an annual export (from Jan 1 - Dec 31 each) of account statements is required; historical periods are covered through multiple separate XML exports.

    Example: Export#1: Mar 15, 2023 (account opening) - Dec 31, 2023; Export#2: Jan 1, 2024 - Dec 31, 2024; Export#3: Jan 1, 2025 - Dec 31, 2025

    For FIFO to be applied correctly, no transaction from the history may be missing – the complete history from account opening is required.

    Done!

    Click Start and download the XML file. You can upload it directly to KapitalTax.

    Ready for Your Report?

    Also for LYNX & CapTrader

    LYNX and CapTrader also use the Interactive Brokers platform. The steps to create the Flex Report are identical. Simply log into your respective account and follow the guide above.

    Appendix: Flex Query Configuration Overview

    This overview shows all required settings at a glance.

    Complete overview of Flex Query configuration with all sections, delivery configuration and general settings
    Overview of all Flex Query settings