Trade history
Trades are also imported from the IBKR Flex Web Service and stored in the trades table.
Fields
- Symbol - OCC option symbol or stock ticker (up to 40 chars).
- Underlying - underlying without the option leg.
- Buy/Sell, Open/Close - direction and whether the position
was opened or closed.
- Quantity, Price, Commission.
- Trade date, Settle date.
- IBKR trade ID - makes every import idempotent.
Idempotency
Just like dividends: the same ibkr_trade_id lands at most once in the DB. Repeated imports skip existing rows.
Display
The dashboard shows the Trades panel. It is collapsible and lists the most recent trades per IBKR account. Filtering and sorting are on the roadmap.
The History page (/history) offers three filters:
- Asset — All / Stocks / Options
- Month — only trades of the selected calendar month (based on trade
date). Useful when you want to reconcile the monthly figures in the Performance chart (e.g. "PUT +18.50 €" for 2026-09): pick the month and set Asset to "Options" — the net-cashflow sum of the PUT rows yields (after FX conversion to EUR) the chart value.
- Symbol — free-text search on the underlying.
The three filters compose without triggering a new backend request.
From the performance chart to the history
The monthly bar chart on the Performance page is intentionally compact (PUT / CALL / Div / Sell / Cumulative per month). When you want to see the individual trades behind a number — e.g. why a month totals +18.50 EUR PUT net:
- Hover a month bar in the chart — the tooltip contains the hint
"Trade-level details: on the History page, pick month … in the dropdown".
- Switch to History (
/history). - In the filter bar set the Month dropdown to the same value.
- Optionally restrict Asset to Options to see only the option rows
contributing to the PUT / CALL figure.
The aggregate cards above the table (cashflow, sells, expired / assigned) recompute on the filtered set, so you can validate the chart value directly.
Configuration
Per user you need:
- Flex token
- Query ID Trades (separate query - not the same as dividends,
to avoid rate-limit conflicts).