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 21 shows a "proceeds" figure and Box 20 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's own reports disagree with each other on cost basis. Its activity statements and Flex realized P&L default to FIFO, a US convention that is not Canadian average cost, while its T5008 Box 20 may use an internal average-cost figure for some positions without applying the full Canadian ACB rules. Either way it sees only the accounts it manages, not your 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.
- IBKR converts at its own transaction-day FX rates. Those do not reliably match the Bank of Canada rates CRA expects for each leg, and part of your currency gain lands on a separate forex worksheet instead of in the stock's figure. ActiveACB applies the Bank of Canada rate to each leg on its own date.
- 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.
IBKR's Tax Optimizer offers FIFO, LIFO, and specific-lot matching, which are all US methods, and none of its reports produce the pooled weighted-average ACB Canada requires. The T5008 itself posts by the end of February.
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.
A separate question the slip never answers is whether your dispositions are on capital account at all. For active traders this is not academic, and the factors CRA weighs are set out in is a T5008 capital gains or investment income.
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
- Corporate actions including splits, mergers, return of capital, name changes, fractional share cash-in-lieu, and standard cost-base spinoffs, with taxable spinoffs flagged for review
With this data, ActiveACB applies the CRA ACB rules that drive your Schedule 3 figures and produces the correct numbers 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. Here is the short version. Run your own broker export through the ACB calculator. Your first calculation is free.
- 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 so nothing is omitted. Corporate actions in particular only appear in the export if their section is selected.
- 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 (multi-file uploads require season access).
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 | Yes: splits, renames, mergers, ROC, reinvested distributions; taxable spinoffs flagged for review |
| T1135 warnings | Not provided | Yes: flagged at $100,000 threshold |
After calculation, the Broker Reconciliation section compares IBKR's own per-symbol realized P&L against the engine's Schedule 3 figure and explains every difference: superficial losses, return of capital, phantom distributions, FX method, options, and short sales. It appears on screen, in your history, and in the PDF report.
Frequently asked questions
My Flex Query only goes back 365 days. What if I have older trades?
Each Flex Query run covers a bounded date range, and saved-query history limits can depend on the account and platform settings. For longer histories, 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 (multi-file uploads require season access). 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" (multi-file uploads require season access). 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, most often because the relevant section was not selected when the query was created. ActiveACB flags any events it cannot fully resolve as warnings in your report. Use the built-in trade editor on the results page to fix, add, or delete rows and re-run instantly, with no re-upload needed; the Raw Trades XLSX round-trip also works for bulk edits.
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.
Prefer ActiveACB in your Google results. Add activeacb.ca as a preferred source and Google shows you more of our tax guides in your own search results.
Add ActiveACB in Google