Creating your Flex Query

A Flex Query is a custom report template inside Interactive Brokers — you define it once, then run it for any date range. ethro needs one template, run twice with different date ranges. Takes about ten minutes the first time.

Why a Flex Query, and not the activity statement other tools ask for?

Activity statements leave out what these schedules need most — each lot's acquisition date and the exact lot every sale closed. A Flex Query is the only IBKR export that carries it, so the figures are reconstructed per lot, not estimated. You run one template twice: the calendar year for Schedule FA, the financial year for CG & OS.

1 · Create the template

  1. Log in to IBKR Client Portal → Performance & ReportsFlex Queries.
  2. Under Activity Flex Query, click + (Create) and name it (e.g. "ethro-schedule-fa").
  3. Add the five sections below, then apply the General Configuration settings in step 3. For each section, set the Options as noted and tick exactly the fields shown — nothing more, nothing less.

2 · Sections and fields

These are the checkbox labels exactly as IBKR shows them in the field picker. IBKR exports them under slightly different internal column names (e.g. "Currency" → CurrencyPrimary, "Realized P/L" → FifoPnlRealized) — that's expected, and the tool reads the exported names for you.

Account Information

For Schedule FA Table A2 (account number and opening date).

Account IDDate Opened

Cash Report

For Table A2's peak/closing cash balance. Ticking Starting Cash and Ending Cash automatically adds their Securities/Commodities sub-columns — that's expected.

OptionsLeave the Options toggles (Base Currency Summary, Currency Breakout, …) OFF.
CurrencyStarting CashEnding Cash

Open Positions

OptionsSet Options to Lot (not Summary) — one row per lot, not per symbol.
CurrencySymbolDescriptionIssuerIssuer Country CodeReport DateQuantityMark PricePosition ValueCost Basis PriceCost Basis MoneyOpen Date Time

Trades

OptionsUnder Options, tick BOTH Execution and Closed Lots — the closed-lot rows carry each sold lot's true acquisition date and cost basis.
CurrencySymbolDescriptionIssuerIssuer Country CodeTrade DateQuantityTrade MoneyIB CommissionBuy/SellProceedsCost BasisRealized P/LOpen Date Time

Cash Transactions

OptionsUnder Options, use Detail (not Summary) and include the income types — Dividends, Payment in Lieu of Dividends, Withholding Tax, 871(m) Withholding, Broker Interest Received, Broker Interest Paid, and Deposits & Withdrawals (selecting all types is fine).
CurrencySymbolDescriptionIssuerIssuer Country CodeDate/TimeAmountType

3 · Delivery & General Configuration

Leave every Delivery and General Configuration setting at its default — the only thing to change is the export Format: switch it from the default XML to CSV. Everything else (column headers, the yyyyMMdd date format, Include Currency Rates: No, and the rest) is already right at its default. The reference screenshots below show the full set of values if you'd like to confirm.

Compare your query against this

Once you've saved the template, open its Details view in IBKR and check it against these reference screenshots — the five sections, their Options, the exact fields, and every Delivery / General Configuration value should match. Your Query ID and account will differ; everything else should be identical.

IBKR Flex Query details: the five sections (Account Information, Cash Report, Cash Transactions, Open Positions, Trades) with their Options and exact fields.
Sections, their Options (Lot; Execution + Closed Lots; Detail), and the exact fields.
IBKR Flex Query Delivery Configuration (CSV, column headers Yes, section codes No) and General Configuration (Include Currency Rates No, Date Format yyyyMMdd, Time HHmmss, Date/Time Separator semicolon).
Delivery & General Configuration — note Include Currency Rates: No.

4 · Run it twice

Calendar year file

Jan 1 – Dec 31 of the calendar year ending inside the financial year you're filing for. Feeds Schedule FA (foreign asset disclosure is calendar-year based).

Financial year file

Apr 1 – Mar 31, India's financial year. Feeds Schedule CG (capital gains) and Schedule OS (dividends, interest).

Run the same template with each date range (Run → custom date range) and download both CSVs. In the tool, first pick your Assessment Year — it then shows the exact Jan 1 – Dec 31 and Apr 1 – Mar 31 dates each file must cover, so you can match your Flex Query runs to them. Upload the calendar-year file on the left and the financial-year file on the right. Assessment Years from AY 2022-23 onwards are supported — including past years you're fixing via a revised or updated return; earlier years generally fall outside the current correction windows (your CA can confirm what applies to your case).

If the upload fails

The most common cause is a section with different fields than listed above — the error message will name the first unrecognized row. Edit the template, match the field list exactly, re-run, re-download. Still stuck? Use the feedback form and describe the error you see.