BrokersJune 4, 2026·5 min read

IBKR trading journal: Activity Flex Query setup and troubleshooting

Configure an XML Activity Flex Query, connect its token and Query ID to MyTradeLens, and check imported fills, dates, and fees.

Written by MyTradeLens - Product documentation

Last materially updated September 22, 2026.


MyTradeLens retrieves Interactive Brokers reports through Flex Web Service. This is a report import, not a live execution feed. You need a saved Activity Flex Query and its Web Service token; MyTradeLens does not need your IBKR password.

1. Create the report in IBKR

  1. In Client Portal, open Performance & Reports → Flex Queries, or Reporting → Flex Queries depending on your portal layout.
  2. Create an Activity Flex Query and include the Trades section. Choose XML output so MyTradeLens can read the report.
  3. Include a date range covering both opening and closing fills. Save the query and copy its Query ID.
  4. Open Flex Web Service Configuration and enable the service. Generate or renew the token and check its expiration.

Menu labels vary by portal version. Use IBKR’s Flex Queries guide and Flex Web Service configuration for the provider’s current controls. IP restrictions on a token must be compatible with the service making the request; contact support before changing a restriction you rely on.

2. Include the fields the importer uses

  • Identity: symbol, assetCategory, conid or securityID; underlyingSymbol for options.
  • Execution: buySell, quantity, tradePrice, dateTime and tradeDate.
  • Costs and matching: ibCommission, netCash, openCloseIndicator, fifoPnlRealized.
  • Options: putCall, strike, expiry, multiplier. Verify the multiplier against the contract; do not substitute a stock quantity for a contract quantity.

These are the XML field names consumed by MyTradeLens. IBKR may show friendly labels when selecting them. Missing fields can produce incomplete dates, option identity, or fee information even when a report imports.

3. Connect in MyTradeLens

  1. Open Data & sync and select Interactive Brokers.
  2. Paste the Flex Token and Activity Flex Query ID into their matching fields.
  3. Choose the same Date Format as the saved query. The default selection is yyyyMMdd.
  4. Save/connect, then run the IBKR sync. Wait for the report response and check the displayed status before retrying.

4. Confirm the import

Pick one closed position with its opening fill present. Compare quantity, entry and exit, commissions, and realized result against the statement. A successful request containing no Trades rows is not a successful first import. New reports may need time to become available.

Common problems

  • Token error: check token expiry and Web Service status; regenerate it in IBKR if needed and replace the saved token.
  • Query error: use the Activity Flex Query ID, not an account number or another report identifier.
  • No trades: check the date range, XML format, Trades section, and recent report availability.
  • Unexpected times or missing entries: verify date/time fields and the date-format selection. Include the opening dates for positions closed during the report window.
  • Duplicates: the sync merges imported records. Check broker filters and trade identities before clearing saved data.

Your next step

Check current pricing and trial terms, then create your account. Already signed in? Open Data & sync, import a small date range, and verify one completed trade before relying on the totals.

After importing, follow the weekly review checklist. If you get stuck, contact support with the broker, date range, and error message. Do not include passwords, access tokens, or account numbers.

Stop rebuilding spreadsheets

MyTradeLens brings Schwab, Interactive Brokers, and Moomoo trades into one journal, reconstructs your round-trips, applies available fees, and helps you review your P&L. Check current pricing and trial terms before subscribing.

$20USD / month

14-day free trial · Cancel anytime.

25% offWith an affiliate code

$15 for your first paid month, then $20/month.

Enter a valid partner code at signup. For new subscriptions.