Command Palette

Search for a command to run...

Interactive Brokers Import

Import your trading history from Interactive Brokers into TradeLogist

4 min read

Interactive Brokers Import

Import your trades directly from Interactive Brokers (IBKR) using their Flex Query reports.

Overview

Interactive Brokers provides detailed trade data through Flex Queries, which TradeLogist can import directly.

Setting Up Flex Query

Step 1: Access Flex Queries

  1. Log in to IBKR Client Portal
  2. Go to Reports > Flex Queries
  3. Or navigate to Performance & Reports > Flex Queries

Step 2: Create New Query

  1. Click Create or + for new query
  2. Choose Activity Flex Query
  3. Name it "TradeLogist Export"

Step 3: Configure Query

Select these sections:

Trades Section:

  • Symbol
  • Date/Time
  • Buy/Sell
  • Quantity
  • TradePrice
  • IBCommission
  • Currency
  • AssetClass

Optional but recommended:

  • AccountId
  • Description
  • Exchange
  • OpenCloseIndicator

Step 4: Set Format

  1. Format: CSV
  2. Period: Custom date range or Last 30 days
  3. Date Format: yyyyMMdd
  4. Time Format: HHmmss

Step 5: Save and Generate

  1. Save your query
  2. Click Run to generate report
  3. Download the CSV file

Importing to TradeLogist

Step 1: Upload

  1. Go to Dashboard > Trades > Import
  2. Select Interactive Brokers
  3. Upload your Flex Query CSV

Step 2: Review Mapping

TradeLogist auto-maps IBKR columns:

IBKR ColumnMaps To
SymbolSymbol
Date/TimeEntry Date/Time
Buy/SellDirection
QuantityQuantity
TradePriceEntry/Exit Price
IBCommissionFees

Step 3: Import Options

Configure import settings:

  • Currency: Keep original or convert
  • Duplicates: Skip, update, or create
  • Strategy: Auto-assign or leave blank

Step 4: Preview and Import

  1. Review the preview
  2. Check for any warnings
  3. Click Import
  4. Confirm completion

Trade Matching

How It Works

IBKR exports individual fills. TradeLogist matches:

  • Opening fills (creates new trade)
  • Closing fills (closes existing trade)
  • Partial fills (updates quantity)

Matching Logic

Example:
Buy 100 AAPL @ 195.50 (opening)
Buy 50 AAPL @ 196.00 (adds to position)
Sell 150 AAPL @ 198.00 (closes position)

Result: One trade with average entry, one exit

Unmatched Trades

If trades don't match:

  • Created as open positions
  • Review and close manually if needed
  • Check for missing fills

Asset Classes

Stocks

Imports directly with:

  • Symbol
  • Quantity
  • Prices
  • Commissions

Options

Additional fields:

  • Underlying symbol
  • Strike price
  • Expiration
  • Put/Call

Futures

Includes:

  • Contract symbol
  • Expiration
  • Multiplier

Forex

Currency pair handling:

  • Base/quote currency
  • Pip values
  • Lot sizes

Commission Handling

What's Imported

IBKR provides detailed costs:

Fee TypeHandling
CommissionAdded to trade
SEC FeeAdded to trade
Exchange FeeAdded to trade
RegulatoryAdded to trade

P/L Calculation

All fees included in P/L:

Net P/L = Gross P/L - Total Fees

Date Range Imports

Initial Import

For first-time import:

  1. Create query for full history
  2. May need multiple queries (yearly)
  3. Import oldest first
  4. Then newer periods

Regular Updates

For ongoing sync:

  1. Set up weekly/monthly query
  2. Import new trades periodically
  3. TradeLogist handles duplicates

Troubleshooting

Common Issues

"Unrecognized symbol format"

  • IBKR uses specific formats
  • Check asset class selection
  • May need manual mapping

"Missing trades"

  • Verify date range covers period
  • Check Flex Query sections
  • Ensure query ran successfully

"Duplicate trades"

  • Enable duplicate detection
  • Check import date range
  • Review existing trades

Flex Query Errors

Query not generating:

  • Check IBKR permissions
  • Verify account access
  • Try regenerating query

Empty results:

  • Check date range
  • Verify trades exist for period
  • Check account selection

Best Practices

Query Setup

  1. Create dedicated query for TradeLogist
  2. Include all relevant fields
  3. Use consistent date format
  4. Test with small range first

Regular Imports

  1. Import weekly or monthly
  2. Keep consistent schedule
  3. Review for accuracy
  4. Handle exceptions promptly

Data Verification

After each import:

  1. Spot check trade details
  2. Verify P/L calculations
  3. Check commission accuracy
  4. Review any warnings

API Integration

Coming Soon

Direct IBKR API integration:

  • Automatic sync
  • Real-time updates
  • No manual export needed

Stay tuned for updates.

Next Steps