product image
product image
product image

QANTS IBKR Statement to R Journal — Python (AR/EN)

$15

Turn an IBKR trades CSV into round-trips, P&L and statistics in R.

A Python journal that reads an Interactive Brokers Flex Query “Trades” CSV or an Activity Statement trades export, groups same-underlying fills that arrive inside a short time window (the multi-leg heuristic: a vertical or iron condor routed together), matches opening groups to closing groups with the opposite position on the same strikes (FIFO), and reports P&L, win rate, expectancy and maximum drawdown in R. R = P&L / the 1R you type.

The package ships a clearly marked SYNTHETIC example (fictional account U0000000 — not a real statement) and the output you should get with --one-r 250: 19 fills → 11 groups → 5 closed round-trips + 1 open lot, P&L 266.20, 1.0648 R, 60% win rate, 0.2130 R expectancy, 0.8660 R max drawdown. Compare a couple of known trades against any live file before you trust new totals.

Includes the script, requirements.txt, bilingual PDF + README, and the fictional example. ClosedLot rows are skipped so FIFO lots are not double-counted.

سكربت يحوّل ملف صفقات IBKR إلى صفقات ذهاب وعودة بوحدات R، مع تجميع تقريبي للأرجل المتزامنة. الملف المرفق مثال وهمي وليس كشفًا حقيقيًا.

Disclaimer: Educational journaling tool only — not financial or tax advice and not a substitute for the official IBKR statement. Time-window grouping can merge unrelated same-second trades or miss staggered legs. Trading involves substantial risk of loss.