Interactive Brokers Canada: Capital Gains, T5008, and Flex Query
IBKR issues a T5008 for every security you sold. The number in Box 20 looks like your cost, but it is not your adjusted cost base under Canadian tax law. Here is what is wrong with it and what you need instead.
The problem with your IBKR T5008
At the end of each tax year, IBKR issues a T5008 (Statement of Securities Transactions) for every security you disposed of. Box 20 shows a "proceeds" figure and a "cost or book value" figure. The cost number looks authoritative. It is not.
The CRA's own instructions for the T5008 state that Box 20 "may or may not reflect your adjusted cost base." IBKR is not required to compute your Canadian ACB. It reports what it tracked internally, which follows different rules than the CRA requires.
- IBKR uses average cost internally, but only within accounts it manages. It does not know about your TFSA or RRSP purchases at other brokers.
- IBKR does not apply the superficial loss rule. If you sold at a loss and reacquired within 30 days, your T5008 shows the full loss. The CRA would deny some or all of it.
- IBKR does not track the $200 FX exemption (ITA s. 39(1.1)) or your USD cash pool ACB.
- Options exercises and assignments that change your share ACB are not reflected in Box 20 of the shares' T5008.
- Corporate actions, including splits, spinoffs, and return of capital, may not be correctly reflected in the reported cost.
Filing using T5008 Box 20 figures is common and often harmless for simple portfolios. For anyone who has traded the same security more than once, held USD, exercised options, or dealt with cross-account positions, the error compounds silently and can lead to a CRA reassessment.
What a Flex Query gives you instead
An IBKR Flex Query XML is a complete export of your account history. Unlike the T5008, it contains every event that affects your ACB:
- Every trade with exact dates, quantities, prices, and commissions
- Every dividend, interest payment, and fee
- Every FX conversion between USD and CAD
- Every option event: opening, closing, exercise, assignment, expiry
- Every corporate action: splits, spinoffs, mergers, return of capital, name changes
With this data, ActiveACB applies every CRA ACB rule and produces the correct figures for your Schedule 3. The Flex Query is the only IBKR export that contains everything the calculation requires.
How to get your Flex Query: 4 steps
The full step-by-step guide with screenshots is at activeacb.ca/guide-ibkr. The short version:
- Log in to IBKR Client Portal. Go to Performance & Reports → Flex Queries.
- Create an Activity Flex Query. Click the + button, name it (for example, TaxQuery), and check Select All in every section's dialog. There are 13 sections, and all are required.
- Set delivery options. Format: XML. Period: Year to Date. Date Format: yyyyMMdd. Click Continue.
- Run the query and upload. Click the Run arrow next to your query, set your date range, download the XML, and upload it to ActiveACB. Use "Add another account" to upload multiple files in one session.
What the IBKR data limitation means for each CRA rule
| CRA Rule | T5008 Box 20 | Flex Query + ActiveACB |
|---|---|---|
| ACB pooling (ITA s. 47) | Partial, within-account only | Full: across all uploaded accounts |
| Superficial loss (ITA s. 54) | Not applied | Full: three-limiter formula, cross-account |
| FX cash pool ACB | Not tracked | Full: USD pool ACB, $200 exemption |
| Options exercise/assignment ACB | Not reflected | Full: all four CRA option cases |
| Corporate actions | Partial | Full: split, spinoff, merger, ROC |
| T1135 warnings | Not provided | Yes: flagged at $100,000 threshold |
Frequently asked questions
My Flex Query only goes back 365 days. What if I have older trades?
IBKR limits each Flex Query run to a rolling 365-day window. For histories longer than one year, run one query per calendar year (for example, Jan 1 2023 to Dec 31 2023, then Jan 1 2024 to Dec 31 2024) and upload all files to ActiveACB in the same session. The engine removes duplicate trades from overlapping date ranges automatically.
I have both a margin account and an IBKR TFSA. Do I need separate Flex Queries?
Yes. Run a Flex Query for each account separately and upload both to ActiveACB in the same session using "Add another account." The engine merges the data, pools ACB correctly across accounts, and detects cross-account superficial losses, including cases where you sold in the margin account and reacquired in the TFSA.
What if some trades or corporate actions are missing from my Flex Query?
IBKR Flex Queries occasionally miss corporate actions or fractional share cash-in-lieu events. ActiveACB flags any events it cannot fully resolve as warnings in your report. You can correct them by downloading your Raw Trades XLSX from your calculation history, editing the relevant rows in Excel, and re-uploading.
Will the Flex Query include my USD cash gains?
Yes. The Flex Query includes all FX transactions. ActiveACB tracks your USD cash pool ACB and computes any gain or loss from currency dispositions, including applying the $200 CAD annual exemption under ITA s. 39(1.1) when applicable.
Do I need to re-run the Flex Query every year?
Yes. Run a fresh Flex Query each tax season. For the most accurate results, include your full account history from inception. The engine uses the full history to build correct pooled ACB for each security, even if you only need dispositions from the current tax year.