Skip to content

Integration · Read-only

Interactive Brokers portfolio analysis

Import the open positions of your IBKR account in a minute, then backtest them, measure their risk, look inside your ETFs and test the crash you fear. MEDGE only reads a report you configure: it cannot place orders or move money.

  • Free plan
  • Stocks and ETFs on every exchange
  • Token stored encrypted

Try the analysis on a portfolio like an IBKR one

The free risk check, filled in with a typical European IBKR portfolio of UCITS ETFs: returns, drawdowns, past crises, value at risk and each holding’s share of the risk, on real data. Change funds and weights freely. With the import, your own positions fill it in.

Start from
Total 100%

From Aug 2019 to Oct 2026 (87 months, rebalanced monthly), this portfolio swung 12.0% a year and fell at most 15.6% from a peak. In its worst 5% of months it lost 6.8% on average. SWDA carries 57.9% of the risk with 50% of the money. The longest time below a previous high was 24 months.

Annual volatility
12.0%
VWCE 13.1%
Maximum drawdown
−15.6%
Dec 2021 → Dec 2022
Worst month
−7.9%
Mar 2020
Worst 12 months
−15.6%
to Dec 2022
VaR 95%, 1 month
−5.4%
loss exceeded in 1 month in 20
CVaR 95%, 1 month
−6.8%
average of the worst 4 months
Sharpe · Sortino
0.87 · 1.46
vs euro overnight rate
Beta
0.89
vs VWCE · corr. 0.97

Where the risk comes from

Share of the money vs share of the portfolio’s variance.

  • SWDA50% money · 58% risk
  • CSSPX20% money · 24% risk
  • EQQQ10% money · 15% risk
  • AGGH20% money · 3% risk

Past crises

Return over each episode, from the month-end before it starts.

EpisodePortfolioVWCE
Covid crash−12.8%−19.1%
2022 inflation and rate rises−13.1%−12.8%

How the funds move together

SWDACSSPXEQQQAGGH
SWDA—0.970.870.35
CSSPX0.97—0.880.30
EQQQ0.870.88—0.35
AGGH0.350.300.35—

Correlation of monthly returns: near 1 they move together, near 0 independently, below 0 in opposite directions.

Monthly total returns with dividends reinvested, in each fund’s trading currency, rebalanced to the weights every month. VaR and CVaR are historical: the 5% cut-off of the monthly returns and the average beyond it. Past results; not a forecast and not investment advice.

What you can do once the positions are in

  • Backtest the allocation

    Replay your current weights over the full price history of each holding, with rebalancing, costs and a benchmark.

    Backtest guide
  • Stress test it

    See what the last crises did to this mix, then shock the markets you worry about in the Stress Lab.

    Stress test guide
  • Look inside the ETFs

    Find the companies you hold through several funds at once and how much the funds overlap by weight.

    ETF overlap guide
  • Measure the risk

    Volatility, worst drawdown, value at risk and how much of the risk each holding brings.

    Free risk check
  • Try alternatives

    Change weights, swap a fund, compare portfolios side by side with the same assumptions.

    Backtesting
  • Keep it as a portfolio

    Save the imported portfolio and come back to it; refresh the positions from IBKR when you want.

    Import guide

Example: a portfolio as it arrives from IBKR

A typical European IBKR account holding UCITS ETFs. This is what the import produces: tickers in MEDGE format and weights by value. Below, what the first analysis shows, computed on real monthly data.

Position in IBKRExchangeTicker in MEDGEWeight
SWDAiShares Core MSCI World UCITS ETF (Acc)BVME.ETFSWDA.MI50%
CSSPXiShares Core S&P 500 UCITS ETF (Acc)BVME.ETFCSSPX.MI20%
EQQQInvesco EQQQ Nasdaq-100 UCITS ETF (Dist)BVME.ETFEQQQ.MI10%
AGGHiShares Core Global Aggregate Bond UCITS ETF EUR Hedged (Acc)BVME.ETFAGGH.MI20%

Not imported in this example: a put option and the EUR cash balance, listed apart.

Annual return
11.9%
Volatility
12.0%
Worst drawdown
−15.6%
Worst 12 months
−15.6%

Backtest Jul 2019 – Sep 2026, monthly rebalancing, total return in euros, before costs and taxes.

The full worked example

How the import works

IBKR’s Flex Web Service delivers a report you design in Client Portal. MEDGE reads only that report, with a token you generate and can switch off at any time.

  1. 1Create the report in Client PortalOpen Performance & Reports (or Reporting) › Flex Queries and create an Activity Flex Query with the Open Positions section, at Summary level, in XML format, for the last business day. Save it and note its Query ID.
  2. 2Turn on the Flex Web ServiceIn Flex Web Service Configuration, enable the service and generate a token. Choose the longest validity (up to one year) and leave the IP restriction empty.
  3. 3Paste token and Query ID in MEDGEOn the Portfolio page, under Import from your broker, choose Connect Interactive Brokers and paste the two values. MEDGE downloads the report straight away to check it.
  4. 4Check the positions, then analyseFix any ticker MEDGE did not recognise, untick what you want to leave out, and open the analysis or save the portfolio.
Step-by-step guide with the exact fields

What is imported, and what is not

ImportedNot imported
InstrumentsStocks and ETFs held long, on any exchangeOptions, futures, bonds, currency balances and short positions: listed as not imported
Data per positionSymbol, description, ISIN, listing exchange, currency, quantity, valueCost basis, lots, realised P&L
WeightsValue of each position converted to the account’s base currency with the FX rate in the reportCash, which does not enter the weights
TimeA snapshot of the open positions on the report date (the last business day)Transactions, dividends, deposits and the account’s past performance
UpdatesOn request, with the Refresh button (at most once a minute per account)Automatic background syncing

Four ways to get an IBKR portfolio into an analysis tool

MethodWhat you doUpdatesWhat you hand over
Flex Web Service (MEDGE)Create a report once in Client Portal, paste its token and Query IDOn request, in one clickA token that only downloads that report
File exportDownload a CSV or XML statement and upload itBy hand, every timeA file with your positions
Aggregation servicesSign in to IBKR through a third-party connectorAutomatic, run by the serviceAccess as defined by the service and IBKR
Typing tickers and weightsEnter each holding yourselfBy handNothing

Security and permissions

No password, no trading permission
You never give MEDGE your IBKR login. The Flex Web Service only delivers reports: it has no function to place orders, transfer money or change settings.
Encrypted token
The token is encrypted before it is stored and is never shown again, not even to you. Only the server reads it, to download your report.
You stay in control
Disconnect in MEDGE to delete the token. In Client Portal you can let it expire or turn the Flex Web Service off.
Nothing stored by default
Positions are read on request and not kept. If you save a portfolio, MEDGE keeps its tickers and weights, not values or quantities.

Plans

Free
Import, backtest, attribution, regimes and Monte Carlo on up to 10 holdings per analysis; one saved portfolio.
Essential and above
The Stress Lab with custom scenarios, more holdings per analysis (25 on Essential, 40 on Plus, 60 on Pro) and more saved portfolios.
Compare plans

Questions

Is the Interactive Brokers import free?

Yes. Connecting IBKR and importing positions works on the Free plan, as do backtests, attribution, regimes and Monte Carlo on up to 10 holdings per analysis. The Stress Lab and larger portfolios need a paid plan.

Can MEDGE place trades or move money in my account?

No. MEDGE connects through IBKR’s Flex Web Service, which only delivers reports you configure. It never sees your password and has no trading or transfer permission.

Does MEDGE track my account continuously?

No. Each import is a snapshot of your open positions on the report date. You refresh it when you want, at most once a minute per account. Transactions, dividends and your account’s past performance are not imported.

Does it work with UCITS ETFs and European exchanges?

Yes. Stocks and ETFs on any exchange are imported, and listings such as Xetra, Borsa Italiana, Euronext and London get the exchange suffix MEDGE uses (VWCE.DE, CSSPX.MI). If an exchange is not recognised, you type the ticker once.

What happens to options, bonds and cash?

They are listed as not imported, with the reason, and stay out of the weights. The analysis covers the stocks and ETFs of the account.

Is this the same as PortfolioAnalyst?

No. PortfolioAnalyst, inside IBKR, reports the performance your account actually achieved. MEDGE analyses the current mix: how it would have behaved historically, where its risk sits and what scenarios would do to it.

Guides and help

MEDGE Capital is not affiliated with Interactive Brokers. Interactive Brokers, IBKR, Client Portal and PortfolioAnalyst are trademarks of their owners. Educational content: not financial advice and not an investment recommendation. Risk disclaimer.