A portfolio analysis lab — not a chart viewer. A workbench where you compose multi-dimensional comparisons of your holdings through point-and-click controls and see the result the moment you adjust a knob.
compare-my-stocks is a desktop app (PySide6 + PyQtGraph + pandas) with deep Interactive Brokers and Polygon integration. Free, open source, no telemetry — BYOK (Bring Your Own Keys): your data stays on disk.
It's meant to provide every stock-chart option you'd want — to make an informed decision or view your portfolio from a new angle. It comes with a research (Jupyter) notebook that provides complementary information of your choice for the relevant stocks.
Slice by ticker, sector, or your own custom groups (e.g. "Airlines", "Cloud", "Banks"); cross against any benchmark, any other ticker, or your full portfolio; switch between price, profit, and value; aggregate a group by mean price or mean performance — every combination is one click apart!
Transactions are pulled directly from Interactive Brokers in real time. They give you realized + unrealized P&L, currency-normalized across markets and automatically split-adjusted. Every parameter combination is reproducible as a saved preset.
If you don't use IB, no problem — just upload a CSV of your transactions from any broker and get a similar experience.
📚 Docs: Quick start · UI reference · Data sources · Configuration · Config help · Command-line · Hosted version
Profit per sector vs the entire portfolio, since a chosen date:
(You won't see your portfolio until you upload your transactions.)
A specific airline, the airlines as a group, and Nasdaq:
ESYJY here is ~48% behind the Nasdaq since 04/01/2021 — and significantly behind airlines as a group. That kind of cross-cut is the point of the app.
- Cross-sectional comparison. Group your tickers (e.g. "Airlines", "Cloud") and compare a group's average against any other ticker, group, or your portfolio.
- Real P&L. Pull realized + unrealized profit, automatically synced with IB, split-adjusted, currency-normalized.
- No vendor lock-in. Works offline once data is cached. Export to CSV. Load your own Jupyter notebook for custom analysis.
- Free and open source. No subscription, no telemetry.
✅ Working ⚪ Present but not finished ⚕️ Planned
- ✅ Price history from Interactive Brokers (via the
ibsrvsidecar) - ✅ Price history from Polygon
- ✅ Crypto and ETFs
- ✅ Stocks from any exchange IB supports
- ✅ Import transactions from My Stocks Portfolio CSV — works with any broker
- ✅ Pull transactions from IB Flex
- ✅ Realized + unrealized P&L
- ✅ Currency normalization (set a base currency; everything converts)
- ✅ Holdings auto-adjusted for stock splits
- ✅ Many graph types: Total Profit, Price, Realized Profit, Compare, …
- ✅ Compare vs another ticker, vs a group, vs your portfolio
- ✅ Show % change / % diff from a chosen point, max, or min
- ✅ Pick top-N stocks or filter by value range
- ✅ Unite a group by avg price or avg performance
- ✅ Save and reload graph parameter presets (
graphs.json) - ⚪ Compare your actual P&L against a hypothetical "what if I'd bought the index instead" portfolio
- ✅ Embedded notebook with the current graph's data preloaded
- ✅ Edit & reload notebook directly from the app
- ✅ One-line correlations:
mydata.act.df.corr(method='pearson') - ✅ Generate graphs from code:
gen_graph(Parameters(type=Types.PRICE | Types.COMPARE, compare_with='QQQ', groups=["FANG"]))
- ⚪ Inline graphs in Jupyter
- ✅ Define & edit categories / groups in the GUI
- ✅ Completely free and open source
- ✅ P/E and price-to-sales overlays
- ⚕️ Bar graphs
- ⚕️ Inflation-adjusted performance
- ⚕️ Web frontend
- 🔴 Not planned: technical-analysis shit
End users should grab the Windows installer from Releases.
This is actually recommended to everyone if not want to mess with Python and dependencies — the installer bundles everything.
For developers on Windows (Python 3.14), one PowerShell line — downloads
install/installdev.ps1 to your temp dir and
runs it. The script pip installs the package and seeds
~/.compare_my_stocks/ with the bundled defaults so the app boots
straight away:
$tmp="$env:TEMP\installdev.ps1"; irm https://raw.githubusercontent.com/eyalk11/compare-my-stocks/master/install/installdev.ps1 -OutFile $tmp; try { & $tmp } finally { rm $tmp -Force -ErrorAction SilentlyContinue }From a checkout, run the script directly — -currentbranch installs
from the working tree, -Branch <name> installs from a different GitHub
branch:
./install/installdev.ps1 # install from GitHub master
./install/installdev.ps1 -currentbranch # install from this checkout
./install/installdev.ps1 -Branch dev # install from a different branchinstalldev.ps1 requires PowerShell, so it's Windows-only. On macOS / Linux
follow the manual recipe in the Quick start
— same two pip + copy-defaults steps installdev.ps1 runs internally.
Full instructions, IB / Polygon configuration, and your first graph are in the Quick start.
Highly configurable. Because of the many options across both configuration and the UI, it is recommended to start with the guide.
- Quick start — install, hook up Interactive Brokers or Polygon.
- UI reference — every control in the main window and what it does. Has a page about pitfalls and interacasies .
- Data sources — how IB / Polygon / Flex / Statement / CSV / RapidAPI fit together: merge behavior, caches, the gotchas the field-by-field docs don't surface.
- Configuration — every field in
myconfig.yaml, grouped by area. - Config help — field-by-field credential reference with screenshots of the broker / RapidAPI pages where each token comes from. (Same content as the GUI's Help tab.)
- Command-line — all launch flags and environment variables.
There are two layers, and they don't overlap:
- Stocks, groups, categories — configure these in the main app GUI.
Use the Add stock combo box to add tickers and the Edit
Groups button to manage groups. State is persisted to
groups.jsonautomatically; don't hand-edit it. - Data sources, credentials, behavior toggles — are all controlled from
~/.compare_my_stocks/myconfig.yaml. Easiest way to edit is the bundled config GUI (though Config/Help button)
More details on configuration in the Configuration guide.
Launch from Start menu → Compare My Stocks. The same folder also has these pre-made shortcuts:
| Shortcut | Effect |
|---|---|
| Compare My Stocks | Normal launch |
| Compare My Stocks (Console) | Keeps the terminal attached so startup logs are visible — use this if something looks wrong |
| Compare My Stocks (Tutorial) | Boots against frozen sample data and runs the guided UI tour |
| Configure Compare My Stocks | Standalone config editor (no main window needed) |
compare-my-stocks.exe (in the install dir) accepts the same flags as
the developer launch below.
python -m compare_my_stocks # normal launch
python -m compare_my_stocks --console # keep the terminal attached so startup logs are visible
python -m compare_my_stocks --debug # DEBUG-level logging
python -m compare_my_stocks --trace # TRACE-level (even more verbose)
python -m compare_my_stocks --nogui --noprompt # headless / CI smoke test
python -m compare_my_stocks --tutorial # launch the guided UI tour
python -m compare_my_stocks --config-file D:\alt.yamlStandalone config editor (same panes as the installer's Configure shortcut):
python -m compare_my_stocks.gui.config_guiSet COMPARE_STOCK_PATH=<dir> to point the whole data dir somewhere
else — caches, myconfig.yaml, groups.json, graphs.json, logs all
live under it.
If something looks wrong, start with --console to see logs.
Full flag list and environment variables in
the CLI reference.
┌──────────────┐ ┌──────────────┐ ┌──────────────────────┐
│ gui (Qt) │────▶│ CompareEngine│────▶│ GraphGenerator │
│ mainwindow │ │ orchestrator│ │ (PyQtGraph) │
└──────────────┘ └──────┬───────┘ └──────────────────────┘
│
┌───────────────┼─────────────────┐
▼ ▼ ▼
┌────────────┐ ┌──────────────┐ ┌──────────────────┐
│ InputProc. │ │ Transactions │ │ DataGenerator │
│ (IB/Poly/ │ │ (IB Flex + │ │ (price/profit/ │
│ Cache) │ │ MyStocks) │ │ compare/group) │
└─────┬──────┘ └──────────────┘ └──────────────────┘
│
▼
┌─────────────┐
│ IBSource │
│ │
└─────────────┘
More detail in CLADUE_REPO.md and the docs site.
pytest src/compare_my_stocks/testsThe suite covers a wide range of functionality — pure utilities (jupytertools,
stockprices.get_hist_split), engine orchestration (call_graph_generator,
required_syms, the synthetic-IB end-to-end path), input-pipeline branches
(InputProcessor.get_hist_sym, get_status_df, currency adjustment),
data-generation parameter grids, serialization round-trips, IB-statement and
ibflex parsing, form/parameter wiring, and the full Qt-form initialization.
Integration tests (real IB Gateway, live RapidAPI) are gated behind
-m integration; the default run is hermetic and offline.
Issues and PRs welcome. Practical setup tips live in the detailed guide and the config-GUI help.
If you want to dig into the code:
CLADUE_REPO.md— architecture overview and conventions (also useful for humans)- Configuration reference — every config field
src/compare_my_stocks/engine/compareengine.py— the orchestratorsrc/compare_my_stocks/processing/— data transformssrc/compare_my_stocks/ibsrv.py— the IB sidecar process
- OS: developed and tested on Windows. Other OSes are unverified.
- Display: designed around 1920×1080. Auto-scales for other resolutions;
set
Running.TryToScaleDisplay: falseif the auto-scale misfires. - Data location: the app creates
~/.compare_my_stocks/(override viaCOMPARE_STOCK_PATH) for logs, caches, and config. - Python: developed and tested on Python 3.14. Older 3.11-based installs may still work but are no longer the primary target.
- Pandas: the on-disk caches (
hist_file.cache,stocksplit.cache,buydicn.cache) are pickled; if you swap pandas versions you may need to migrate them. Don't silently delete the caches — they hold data that's not always re-fetchable.
- No warranty. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM USE OF THIS SOFTWARE — including any claim associated with usage of the Interactive Brokers API. Consult the relevant providers' licenses before use. (w.l.g)
- The software can consume CSVs exported from My Stocks Portfolio & Widget by Peeksoft.
- This project was developed individually in spare time without any compensation. The author is not affiliated with Interactive Brokers, Polygon, Peeksoft, or any mentioned company.
- The author takes no responsibility for the correctness of any displayed data, including graph and computed P&L. ( w.l.g)
eyalk5@gmail.com · contributions and bug reports welcome.
As a side note, this is not a newbie project - I am quite veteran in coding (despite being a researcher). And I tried to make it as intuitive and user-friendly as possible(as well as pretty well-tested). However, it's a complex project with many moving parts, done in my spare time and mistakes can happen.

