DocumentationReference

Canary reporting Flex query

Generated by scripts/docgen/edge-flex from internal/flexstmt.CanonicalQueryManifest. Do not edit by hand. Run make docs-regen after changing the manifest.

Canary needs one XML Activity Flex Query for reconciliation, statement-derived equity, and Edge. The consumers share the existing [flex] query ID and token contract. The query profile version is canary-reporting-flex-v2. Follow Set up broker reporting for the screenshot-driven Client Portal workflow and secure activation.

Setup

  1. Open the saved XML Activity Flex Query in IBKR Client Portal and add every Canary reporting section shown below.
  2. For each section choose Select All; keep Trades at Executions detail and Open Positions at Summary detail, then save.
  3. Run canary setup reporting to validate it. Canary names sections that were absent, empty, or missing fields and explains the repair.

Reporting diagnostics keep three broker-evidence states separate: absent means the section was not returned, empty means its container was returned with no rows, and missing names fields absent from a real row. Absent and empty sections cannot prove their selected fields because IBKR may omit enabled sections with no matching activity; the setup wizard explains exactly what to check and asks before accepting that ambiguity.

Required sections and fields

Trades

XML Trades > Trade; level of detail Executions.

Financial Instrument Information

XML SecuritiesInfo > SecurityInfo.

Open Positions

XML OpenPositions > OpenPosition; level of detail Summary.

Options, Exercises, Assignments and Expirations

XML OptionEAE > OptionEAE.

Corporate Actions

XML CorporateActions > CorporateAction.

Transfers

XML Transfers > Transfer.

Cash Transactions

XML CashTransactions > CashTransaction.

Net Asset Value (NAV) Summary in Base

XML EquitySummaryInBase > EquitySummaryByReportDateInBase.

Optional currency conversion rates

Some Client Portal account and interface variants offer a Currency Conversion Rate section; others do not. When it is available, selecting all four fields (dateTime, fromCurrency, toCurrency, and rate) gives Edge dated broker FX evidence for non-base-currency horizons. Its XML shape is ConversionRates > ConversionRate. It is optional and its absence never blocks reporting setup. Forex Balances and Forex P/L Details are different reports and are not substitutes. Rows that still lack enough broker-stated FX evidence remain unscored with a typed reason.

Retrieval and evidence

The ordinary daily report refreshes the trailing 35 days. Edge additionally requests four paced, resumable ranges covering the inclusive trailing 365 days and revalidates the full year monthly. A schema change in the latest report restarts that full-year validation even when the saved Query ID did not change. Every complete active-query XML response is retained as the original broker evidence; SQLite holds the typed current projection and immutable record versions. Candidate validation parses XML only in memory and discards it.

A backfill chunk advances only when the returned statement range fully contains the requested inclusive range. A shorter or stale broker response is retained as evidence but retried; it cannot mark the full-year revalidation complete.

Reading canary reporting status, canary_reporting, canary edge, canary_edge, or /api/edge never starts a Flex or market-data request. Only the explicit setup validation or background acquisition lane contacts Flex. Background work publishes a new fingerprinted snapshot atomically after the evidence and exact-ConID daily bars have been processed.

Safety and scope

Broker reporting and Edge are read-only. Public results contain fingerprints and typed requirements, not account IDs, Flex query IDs, tokens, order or execution IDs, statement filenames, file paths, raw XML, or broker free text. Decision price impact is a fixed price-path comparison, not generic P/L, causality, predictive skill, or investment advice. See Canary Edge for the calculation and limitations.