Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/en/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ nav:
- Import: reference/file/import/index.md
- CSV-file: reference/file/import/csv-import.md
- PDF document: reference/file/import/pdf-import.md
- Interactive Brokers Flex Query: reference/file/import/ibflex-import.md
- Export: reference/file/export.md
- Currency: reference/file/currency.md
- View Menu:
Expand Down
39 changes: 39 additions & 0 deletions docs/en/reference/file/import/ibflex-import.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Importing Interactive Brokers Flex Queries
---

Interactive Brokers allows clients to export account activity as an XML file.

## Creating an Activity Flex Query

You need to create a Flex Query for Portfolio Performance before being able to export data for the first time. See [Create an Activity Flex Query](https://www.ibkrguides.com/clientportal/performanceandstatements/activityflex.htm) at Interactive Brokers on how to create a new query.

Here are the necessary parameters:

- Select at least the following _Sections_ ("Select All" rows unless noted otherwise).
- Account Information (select Account ID, Account Alias and Currency)
- Cash Transactions
- Corporate Actions
- Sales Tax Details
- Trades
- Change "Include Currency Rates?" to "Yes" under "General Configuration".

## Importing from an Activity Flex Query

Run the previously created Flex Query, see [Run a Flex Query](https://www.ibkrguides.com/clientportal/performanceandstatements/runflex.htm) at Interactive Brokers on how to do this.

In Portfolio Performance, use `File > Import > Interactive Brokers: Activity Flex Query` and select the XML you've just downloaded.

Note that you can import transactions from multiple Interactive Brokers accounts at the same time by changing the Flex Query to include multiple accounts via "Delivery Options", "Accounts".

### Automatically matching Interactive Brokers accounts to securities accounts

Interactive Brokers accounts have an ID like U1234567, which is not particularly memorable. The importer will therefore also consider the account alias when trying to match a transaction to a securities account.

For example, an Interactive Brokers account with ID U4242424 and alias "Hotblack Desiato" will match a securities account named either "U4242424" or "Hotblack Desiato".

### Handling transactions in multiple currencies

A single Interactive Brokers account has multiple foreign currency balances, but Portfolio Performance only supports a single reference account per securities account. The importer uses a rule of thumb to allow matching transactions in foreign currency to the correct deposit accounts.

The rule is that any deposit account which starts with the name of the reference account is considered a candidate. For example, if the reference deposit account is called "IB" accounts called "IB EUR", "IB CHF" match the rule of thumb.
2 changes: 1 addition & 1 deletion docs/en/reference/file/import/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ todo: templates, experimental features

In Portfolio Performance you can enter your data (buy, sell, dividends, historical quotes, … ) manually but you can also *import* this info from a CSV file (comma-separated values) or from a PDF document. Figure 1 displays the expanded `File > Import` menu.

There are two primary data sources: [PDF documents](pdf-import.md) and [CSV files](csv-import.md) (comma-separated values). Some brokers or banks may present this information in a proprietary format. Templates for major banks or brokers are available.
There are several data sources: [PDF documents](pdf-import.md), [CSV files](csv-import.md), and broker-specific formats like [Interactive Brokers Flex Queries](ibflex-import.md). Some brokers or banks may present this information in a proprietary format. Templates for major banks or brokers are available.

Figure: Menu File > Import.{class=pp-figure}

Expand Down