Connect Interactive Brokers (direct)

Step-by-step guide to connecting Interactive Brokers to Option Anatomy: two report templates and one reporting-only access key, set up once in Client Portal.

The direct connection reads your account through IBKR's own reporting service. You set it up once — two report templates and one reporting-only access key in IBKR Client Portal, about five minutes — then paste three values into Option Anatomy. From then on it's automatic: positions refresh about every 2 minutes during trading, and a new fill typically shows up within a minute or two of executing.

Use this direct path for IBKR rather than the general brokerage portal, because the portal route only refreshes IBKR holdings once a day. The in-app page (Settings → Link brokerage → Interactive Brokers) walks through the same steps one screen at a time, with a picture of each IBKR screen, and asks for each value as you reach it.

Step 1: Create the positions report

  1. In IBKR Client Portal: Performance & Reports → Flex Queries, then click “+” under Activity Flex Query.
  2. Name it OptionAnatomy-Positions.
  3. Enable exactly these sections, leaving every other one off: Account Information, Open Positions, Trades, Option Exercises Assignments & Expirations, Financial Instrument Information, and Net Asset Value (NAV) in Base. Selecting all fields inside each is fine; Open Positions must include the Summary level.
  4. Leave the symbols filter empty and select your account number.
  5. Period: Last Business Day. Format: XML.
  6. Date format yyyy-MM-dd, time format HH:mm:ss, separator semicolon (;).
  7. General configuration: Profit and Loss “Default”, and answer No to everything else (offsetting pairs, currency rates, audit trail, account alias, breakout by day).
  8. Click Continue, then Create. Back on Flex Queries, click the “i” beside OptionAnatomy-Positions: the pop-over shows its numeric Query ID, which you'll paste in step 4.

Step 2: Create the fills report

  1. On the same screen, click “+” under Trade Confirmation Flex Query and name it OptionAnatomy-Fills. This is the live one: your trades appear in it within a minute or two of filling.
  2. Period: Today (IBKR sets this one for you).
  3. In the trade-confirmation picker, tick Execution only — leave Order and Symbol Summary unticked. Select All in the field list below is fine.
  4. Format XML with the same date/time settings as step 1, then Continue and Create, and note this report's Query ID from its “i” pop-over too.

Keep “Order” unticked. A report carrying order rows beside execution rows counts every fill twice, and the connect check in step 4 detects this and tells you exactly what to change.

Step 3: Turn on the access key

  1. On the same Flex Queries screen, click the gear on Flex Web Service Configuration, tick Flex Web Service Status and save.
  2. Click Generate New Token, set Expire After to 1 Year (it starts at 6 hours) and click Generate New Token again. The app reminds you before it lapses, with a one-click path to renewal.
  3. Leave the IP restriction blank (recommended), and copy the Current Token IBKR shows you.

This token is reporting-only by IBKR's design, so it can pull reports and nothing else.

Step 4: Paste into Option Anatomy

  1. In the app: Settings → Link brokerage → Interactive Brokers.
  2. Paste the token and the two Query IDs — positions from step 1, fills from step 2.
  3. Click Connect. The app validates with a live pull of both reports before storing anything; a misconfiguration comes back with the exact fix spelled out.
  4. If it times out, IBKR is still generating a report — wait a minute and click Connect again.

What happens after you connect

  • Each morning (~05:30 ET) the app pulls your official closing book — positions, cost basis, expirations, assignments — and reconciles it against the day's fills.
  • About every 2 minutes during market hours it pulls the fills report, so a new execution lands on your book within a minute or two, priced live by the app's own market-data engine from the moment it appears.
  • Expiring options settle from IBKR's own exercise and assignment records, never guesses.
  • Before the 1-year token lapses you get a reminder; renewing means repeating step 3 and re-pasting on the same page.