How to set up an IBKR Flex Query

Interactive Brokers can export your trade history automatically through a Flex Query, a read-only reporting feature built into your IBKR account. This is how you set one up, and how to connect it to GeckoPro so your holdings stay in sync without any manual CSV exports.

⏱ About 5 minutes 🔒 Read-only, no password shared 🇳🇿 Written for NZ & AU investors
What a Flex Query actually is. It's IBKR's own reporting tool. You define what data you want (in this case, your trades), IBKR generates it on request, and a token lets an app fetch it. The token can read reports. It cannot place trades, cancel orders, or move money. That limitation is built into IBKR's design, not something GeckoPro promises.
Step 1

Enable your Flex Web Service token

  1. Log into IBKR Account Management on the web. This won't work from the desktop TWS app, it has to be the browser portal.
  2. Go to Performance & Reports → Flex Queries
  3. Scroll down to Flex Web Service Configuration
  4. Tick Flex Web Service Status to turn it on
  5. Copy your Current Token. You'll paste this into GeckoPro shortly. Keep it somewhere safe in the meantime, it's the credential that lets the report be fetched.
Step 2

Create an Activity Flex Query

  1. On the same page, click Create to make a new Activity Flex Query
  2. Name it anything you like. GeckoPro works.
  3. Under Sections, add Trades, then select these fields:
    Symbol · Asset Category · Buy/Sell · Quantity · Trade Price · Trade Money · IB Commission · Net Cash · Trade Date · Listing Exchange · Description · Currency · Trade ID
  4. Set Date Range to Last 365 Calendar Days
  5. Set Format to XML
  6. Save. IBKR will show a Query ID next to the query name, a 6-digit number. Copy that too.
Step 3

Connect it to GeckoPro

  1. In GeckoPro, go to your portfolio settings and choose the IBKR connection option
  2. Paste your Flex token and Query ID, then hit Connect
  3. Your full trade history imports immediately. From then on, GeckoPro re-syncs automatically each weekday morning, so your holdings and cost basis stay current without you doing anything.
What gets imported. Stock and ETF trades (STK/ETF) in USD, NZD or AUD. Options, FX and bonds are skipped, GeckoPro monitors equities, so those instruments wouldn't produce meaningful signals anyway. Your IBKR login is never shared with GeckoPro at any point.

Common questions

Is a Flex Query read-only?

Yes. Flex Queries are IBKR's reporting feature. A Flex Web Service token can read your trade and position reports. It cannot place, modify or cancel orders, and it cannot move funds. That's a limitation of IBKR's own system, not a policy GeckoPro is asking you to trust.

Do I have to give GeckoPro my IBKR password?

No. You create the Flex Query inside your own IBKR account and share only the token and query ID. Your IBKR username and password never leave IBKR.

Which trades get imported?

Stock and ETF trades (STK/ETF) denominated in USD, NZD or AUD. Options, FX and bonds are skipped.

How often does the sync run?

Your full trade history imports immediately when you connect. After that, GeckoPro re-syncs automatically each weekday morning, so new trades appear without you re-exporting anything.

Can I revoke access later?

Yes. You can regenerate or disable the Flex Web Service token in IBKR at any time, or delete the query entirely. Access stops immediately, and you don't need to go through GeckoPro to do it.

Why does the date range need to be 365 days?

So GeckoPro can calculate your cost basis and returns from your actual trades rather than estimating them. A shorter window would miss older positions and leave your P&L incomplete.

What if I use a different broker?

GeckoPro supports CSV import from any broker that exports transaction history, including Sharesies and Hatch. Flex Query sync is specific to Interactive Brokers.

General information only. Not personalised financial advice. GeckoPro is a monitoring tool and is not a Financial Advice Provider. We do not hold an FMA licence. Investing involves risk, including possible loss of capital. GeckoPro is not affiliated with, endorsed by, or connected to Interactive Brokers LLC. IBKR's interface may change over time, so if a step here no longer matches what you see, get in touch and we'll update it.