Importing from Interactive Brokers
Step-by-step guide to downloading your transaction history from Interactive Brokers and importing it into TrackMyShares for tax reports.
This guide walks you through exporting your trade history from Interactive Brokers (IBKR) and importing it into TrackMyShares to generate tax reports.
Step 1: Download your transaction history from IBKR
Interactive Brokers offers two ways to export your trades. Flex Queries give you the most control over the output format.
Using Flex Queries (recommended)
- Log in to IBKR Client Portal
- Go to Performance & Reports > Flex Queries
- Click the + icon next to Activity Flex Queries to create a new query
- Name the query (e.g., "TrackMyShares export")
- In the available sections, select Trades and choose Select All fields
- Set the date range to cover the period you need
- Choose CSV as the output format
- Click Run to download the file
Using activity statements
- Log in to IBKR Client Portal
- Go to Performance & Reports > Statements
- Select Activity Statements
- Choose your date range (maximum 365 days per statement)
- Select CSV as the format
- Download the file
Tip: IBKR limits activity statements to 365 days. For multiple years, download separate files for each year.
Step 2: Prepare the CSV for TrackMyShares
TrackMyShares expects these columns for portfolio transaction imports:
Required columns
| Column | Description | Example |
|---|---|---|
| Symbol | Stock ticker | AAPL |
| Market | Exchange or market | US, AUS |
| Type | Transaction type | BUY, SELL, DIVIDEND |
| Quantity | Number of shares | 50 |
| Price | Price per share | 150.00 |
| Date | Transaction date | 2024-01-15 |
Optional columns
| Column | Description | Example |
|---|---|---|
| Fees | Brokerage or commission | 1.00 |
| Withholding Tax | Tax withheld at source | 15.00 |
| Franking Credits | Australian franking credits | 0.32 |
| Amount | Total transaction amount | 250.00 |
| Notes | Additional notes | Quarterly buy |
| External ID | Broker trade reference | 12345 |
Formatting IBKR data
IBKR's CSV format can be complex because activity statements mix different data types (trades, dividends, fees, forex) in the same file. You may need to clean the file in a spreadsheet first:
- Filter rows: IBKR activity statements include section headers and mixed data. Keep only the rows under the "Trades" section for trade imports, or the "Dividends" section for dividend data
- Market: IBKR doesn't include a simple market column. If all your trades are on the same exchange, set the market value in the column mapping UI during import (e.g.,
US). If you have a mix of markets, add aMarketcolumn to the CSV withUSorAUSper row - Type: IBKR uses "BOT" for buy and "SLD" for sell in some exports. You may need to replace these with
BUYandSELL - Fees: IBKR uses "Commission" — this is auto-detected
- Dates: IBKR typically uses
YYYY-MM-DDformat, which is auto-detected - Numbers: Currency symbols (
$), commas, and quotes are automatically stripped
Example formatted CSV
Symbol,Market,Type,Date,Quantity,Price,Fees
AAPL,US,BUY,2024-01-15,50,185.00,1.00
MSFT,US,BUY,2024-02-20,25,410.00,1.00
AAPL,US,SELL,2024-06-10,25,195.00,1.00
VAS,AUS,BUY,2024-03-01,100,85.00,6.00
AAPL,US,DIVIDEND,2024-05-10,50,0.25,0
Step 3: Import into TrackMyShares
- Open your transaction-based portfolio in TrackMyShares
- Click Import > Import portfolio transactions
- Upload your CSV or XLSX file
- Review the column mapping — adjust any columns that weren't auto-detected
- If prompted, select the correct date format
- Review the preview — check for any validation errors or warnings
- Click Import transactions
Note: If you don't have a transaction-based portfolio yet, create one first. Transaction-based portfolios are available on the Pro plan and are required for tax report generation.
Step 4: Generate your tax report
Once your transactions are imported:
- Open your portfolio
- Click Tax report in the portfolio menu
- Select the financial year
- Review your capital gains, losses, and dividend income
The tax report calculates your capital gains using the FIFO method (first in, first out) and applies the CGT discount where applicable.
Troubleshooting
Mixed data in activity statements
IBKR activity statements contain multiple sections (trades, dividends, interest, fees, forex). Open the file in a spreadsheet, filter for the relevant section, and save as a new CSV before importing.
Sell before buy error
Ideally, import your full transaction history so that every buy is recorded before any corresponding sell.
If importing your full history isn't possible, you can import the previous year's portfolio valuation first. This creates a TRANSFER_IN for each holding, establishing an opening balance. Then import the current year's transactions on top of that.
This approach gives you what you need for a tax report, but there's one caveat: the portfolio valuation import records transfer-in dates as the date of the import, not the original purchase date. This means shares held for over 12 months may appear as short-term holdings rather than long-term, which affects the CGT discount.
To fix this, go to the affected holding, click the transactions icon, and edit the transfer-in transaction date to reflect when the shares were originally purchased.
Multiple files
If you had to download separate files for different years, import them one at a time in chronological order. Exact duplicate transactions are skipped automatically.
Next steps
After importing your transactions, explore these features:
- Generate tax reports for EOFY with capital gains and dividend income
- Track dividends including US withholding tax
- Calculate CGT for individual transactions