Skip to content

How to backtest your Interactive Brokers portfolio

A backtest replays your current IBKR weights over past prices. It shows how this mix would have behaved, not what your account earned. Here is the method, a worked example on real data and the limits to keep in mind.

Run the backtest on a portfolio like an IBKR one

This is the free portfolio backtest, filled in with the demo portfolio used on this page. Change funds, weights, rebalancing and costs, or add a second portfolio to compare. Once you import your positions, MEDGE fills it in with your IBKR weights.

1 · Your portfolio

Start from
  • SWDA iShares Core MSCI World UCITS ETF (Acc) · EUR%
  • CSSPX iShares Core S&P 500 UCITS ETF (Acc) · EUR%
  • EQQQ Invesco EQQQ Nasdaq-100 UCITS ETF (Dist) · EUR%
  • AGGH iShares Core Global Aggregate Bond UCITS ETF EUR Hedged (Acc) · EUR%

● Total 100% · up to 10 holdings

2 · Compare with

Fund or ready-made portfolio

3 · Settings

Rebalancing
Annual return (CAGR)
+11.7%
€10,000 became
€22,306
Worst fall
−15.6%
Sharpe ratio
0.88

Aug 2019 to Oct 2026: 87 months that all chosen funds and VWCE have in common. Rebalanced every December.

Return and risk of the portfolio and of VWCE
Your portfolioVWCE
Annual return (CAGR)+11.7%+12.8%
€10,000 became€22,306€23,883
Volatility12.0%13.1%
Sharpe ratio0.880.89
Sortino ratio1.491.44
Worst fall (max drawdown)−15.6%−19.1%
Longest time below a previous high2.0 years2.0 years
Best calendar year+28.1%+28.6%
Worst calendar year−15.6%−13.5%
Best month+9.2%+9.4%
Worst month−7.7%−11.3%
Months with a gain60%63%

Against VWCE: correlation 0.97, beta 0.89. In the months VWCE rose the portfolio moved 90% as much on average; in the months it fell, 89% as much.

Sharpe and Sortino use the euro overnight rate (XEON) as the risk-free rate. Return, volatility and the ratios do not depend on the money added or withdrawn.

Growth of €10,000

€0€5k€10k€15k€20k€25k2020202220242026
Your portfolio VWCE

Falls from the previous high

Distance from the previous high at each month-end.

-20%-10%0%202020232026
Your portfolio VWCE

The five deepest falls of your portfolio

Deepest falls of the portfolio from a previous high, with the time to recover
HighLowFallHigh to recovery
Dec 2021Dec 2022−15.6%2.0 years
Jan 2020Mar 2020−14.0%7 months
Jan 2025Apr 2025−12.0%9 months

How it held up in past crises

Return from the month-end before each episode to the month-end at its low. The dates follow the month-end highs and lows of the S&P 500.

Return of the portfolio and of the comparison in past market crises
EpisodeYour portfolioVWCE
Covid crashDec 2019 – Mar 2020−12.6%−19.1%
2022 inflation and rate risesDec 2021 – Sep 2022−13.2%−12.8%

Every calendar year

Lighter bars: year not complete in this period.

-10%0%10%20%30%2020202220242026
Your portfolio VWCE
Table of yearly returnsShow
YearPortfolioVWCE
2026(partial)+13.8%+17.5%
2025+5.8%+9.2%
2024+24.1%+24.4%
2023+20.1%+18.2%
2022−15.6%−13.5%
2021+28.1%+28.6%
2020+8.8%+5.4%
2019(partial)+5.7%+8.0%

Every month

Return of the portfolio in every month, by year
YearJanFebMarAprMayJunJulAugSepOctNovDecYear
20260.10.5−3.16.51.25.2−1.71.91.51.3+13.8%*
20253.0−2.4−7.0−3.15.2−0.15.5−0.52.43.9−0.5−0.0+5.8%
20243.32.83.2−2.01.25.2−0.1−0.31.41.16.6−0.4+24.1%
20234.70.5−0.90.05.53.21.9−0.3−1.8−2.95.53.5+20.1%
2022−5.2−1.93.7−3.3−3.2−5.39.2−2.2−5.13.1−0.2−5.4−15.6%
20210.61.94.91.9−0.74.62.02.8−1.94.61.43.2+28.1%
20201.6−6.8−7.78.31.91.90.45.1−1.2−2.07.01.5+8.8%
2019−1.02.2−0.03.80.7+5.7%*

Monthly returns in %. * year not complete in this period.

Rolling returns

Annualised return over every period of that length inside the dates above: what you would have earned starting in any month.

Worst, median and best annualised return over every rolling period
Holding periodWorstMedianBest
1 year76 periodsYour portfolio−15.6%+11.9%+34.0%
VWCE−13.5%+13.7%+43.2%
3 years52 periodsYour portfolio+5.6%+10.3%+17.7%
VWCE+5.4%+11.3%+20.5%
5 years28 periodsYour portfolio+9.1%+11.2%+13.4%
VWCE+10.1%+12.1%+15.1%

Risk of each holding

Each holding over the same months, and how much of the portfolio’s ups and downs it accounts for at the target weights.

Return, volatility, worst fall and share of risk of each holding
HoldingShare of the moneyShare of the riskMoney vs riskReturn a yearVolatilityWorst fall
SWDA50%58%+13.4%14.0%−18.6%
CSSPX20%24%+15.1%14.9%−17.7%
EQQQ10%15%+19.8%19.3%−30.5%
AGGH20%3%−1.0%4.6%−17.2%

SWDA has 50% of the money and 58% of the risk. Grey bar: share of the money; coloured bar: share of the portfolio’s variance.

Monthly total returns with dividends reinvested; the funds’ own costs are included, trading costs, taxes and inflation are not. Historical simulation, not a forecast and not investment advice.

What a backtest of your IBKR portfolio answers

Once the positions are imported, a backtest takes today’s weights and applies them to the price history of each holding, with the rebalancing and costs you choose. It answers questions about the allocation: how deep it fell in past crises, how long it took to recover, how much of the risk each fund carried, and whether a simpler alternative would have done as well.

It does not reconstruct your account’s performance. Deposits, trades, the dates you bought and the taxes you paid are not in a backtest; for the return your account actually achieved, IBKR’s own reports (PortfolioAnalyst) are the reference.

Worked example on real data

Demo portfolio, as the import produces it from a European IBKR account: 50% SWDA.MI, 20% CSSPX.MI, 10% EQQQ.MI, 20% AGGH.MI (iShares Core MSCI World; iShares Core S&P 500; Invesco EQQQ Nasdaq-100; iShares Core Global Aggregate Bond).

Demo portfolio100% MSCI World
Annual return11.9%13.7%
Volatility12.0%14.0%
Worst drawdown−15.6% (Dec 2021 – Dec 2022)−18.6% (Jan 2020 – Mar 2020)
Worst 12 months−15.6% (to Dec 2022)−13.9% (to Dec 2022)
Longest time below a previous high24 months24 months
Sharpe ratio0.890.90
Sortino ratio1.521.51

Monthly total returns in euros from the listings above, Jul 2019 – Sep 2026 (the period all four funds share), rebalanced monthly to the target weights, before costs and taxes. Sharpe and Sortino use the euro overnight rate (XEON) as the risk-free return. Past results do not predict future returns.

What the numbers say

  • The portfolio’s worst drawdown was −15.6%, against −18.6% for MSCI World alone: the bond sleeve softened the fall.
  • Annual return 11.9% against 13.7%, with volatility of 12.0% against 14.0%.
  • SWDA.MI is 50% of the money but carries 57.8% of the risk: weight in money and weight in risk are different things.

Where the risk comes from

HoldingWeightShare of riskCorrelation with the portfolio
SWDA.MI50%57.8%0.99
CSSPX.MI20%24.3%0.98
EQQQ.MI10%14.7%0.92
AGGH.MI20%3.1%0.41

Share of risk: the part of the portfolio’s variance each holding brings (weight × covariance with the portfolio ÷ portfolio variance). The shares add up to 100%.

How to do it in MEDGE

  1. 1Import the positions. Connect Interactive Brokers on the Portfolio page and check the tickers.
  2. 2Open the analysis. Analyze fills the portfolio analyzer with the imported weights.
  3. 3Set the assumptions. Period, rebalancing frequency, transaction costs and a benchmark. Defaults are sensible; change one at a time to see what matters.
  4. 4Read the results. Returns and drawdowns first, then attribution (which holding drove the result) and regimes (how the mix behaved in calm and turbulent markets).
  5. 5Try an alternative. What-If changes a weight or swaps a fund and replays the same test, so you compare like with like.

Choices that change the result

  • Period: the test can only start when the youngest holding has prices. A fund launched recently shortens the history, and short histories miss crises.
  • Rebalancing: monthly, yearly or never. Without rebalancing the winners grow and the risk drifts away from the weights you set.
  • Costs: trading costs and fund fees reduce returns more than they seem over long periods.
  • Currency: each instrument is analysed in the currency it trades in. Mixing a fund in dollars with one in euros compares two different return streams.

What research says about backtests

A backtest is a single path through history. Bailey, Borwein, López de Prado and Zhu show that when many variants of a strategy are tried on the same data, the best backtest tends to look better than its future[1]. Testing the weights you hold once is far less exposed than searching for the best weights, but the warning applies as soon as you start tuning them.

Harvey and Liu propose discounting a backtest’s Sharpe ratio for the number of tests behind it[2]: a high Sharpe found after many attempts deserves less trust than the same number found at the first try.

Simple rules are hard to beat out of sample: across 14 optimised allocation models and seven datasets, DeMiguel, Garlappi and Uppal found none that was consistently better than equal weights[3]. Comparing your mix with a plain alternative, as in the example, is a useful check.

How the example is calculated

Monthly total returns (dividends reinvested) of each listing in its trading currency, from the archive behind MEDGE’s ETF pages, over the months every holding has in common. The portfolio is rebalanced to its target weights every month. Annual return is the compound growth rate; volatility is the standard deviation of monthly returns times √12; a drawdown is the fall from the previous peak of the growth of one euro; Sharpe and Sortino use the euro overnight rate (XEON) as the risk-free return; a holding’s share of risk is its weight times its covariance with the portfolio, divided by the portfolio’s variance.

Questions

Is a backtest the same as my IBKR performance?

No. A backtest applies today’s weights to past prices. Your IBKR performance depends on when you invested, how much, and what you traded. Use PortfolioAnalyst in IBKR for the return your account achieved.

How far back can the backtest go?

As far as the youngest holding allows: the test needs prices for every fund in every month. MEDGE shows the common period and which holding limits it.

Are dividends included?

Yes: returns are total returns, with dividends reinvested, before taxes.

Can I backtest a portfolio of UCITS ETFs?

Yes. European listings are tested on their own price history in their trading currency, as in the example on this page.

Does it cost anything?

Backtests, attribution, regimes and Monte Carlo are on the Free plan, up to 10 holdings per analysis.

Related

Sources

  1. [1] Bailey, D. H., Borwein, J. M., López de Prado, M., & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5), 458–471. doi.org/10.1090/noti1105
  2. [2] Harvey, C. R., & Liu, Y. (2015). Backtesting. The Journal of Portfolio Management, 42(1), 13–28. doi.org/10.3905/jpm.2015.42.1.013
  3. [3] DeMiguel, V., Garlappi, L., & Uppal, R. (2009). Optimal Versus Naive Diversification: How Inefficient is the 1/N Portfolio Strategy? Review of Financial Studies, 22(5), 1915–1953. doi.org/10.1093/rfs/hhm075

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.