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
- SWDA iShares Core MSCI World UCITS ETF (Acc) · EUR%since 2010
- CSSPX iShares Core S&P 500 UCITS ETF (Acc) · EUR%since 2010
- EQQQ Invesco EQQQ Nasdaq-100 UCITS ETF (Dist) · EUR%since 2010
- AGGH iShares Core Global Aggregate Bond UCITS ETF EUR Hedged (Acc) · EUR%since 2019
● Total 100% · up to 10 holdings
2 · Compare with
3 · Settings
- 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.
| Your portfolio | VWCE | |
|---|---|---|
| Annual return (CAGR) | +11.7% | +12.8% |
| €10,000 became | €22,306 | €23,883 |
| Volatility | 12.0% | 13.1% |
| Sharpe ratio | 0.88 | 0.89 |
| Sortino ratio | 1.49 | 1.44 |
| Worst fall (max drawdown) | −15.6% | −19.1% |
| Longest time below a previous high | 2.0 years | 2.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 gain | 60% | 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
Falls from the previous high
Distance from the previous high at each month-end.
The five deepest falls of your portfolio
| High | Low | Fall | High to recovery |
|---|---|---|---|
| Dec 2021 | Dec 2022 | −15.6% | 2.0 years |
| Jan 2020 | Mar 2020 | −14.0% | 7 months |
| Jan 2025 | Apr 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.
| Episode | Your portfolio | VWCE | Difference |
|---|---|---|---|
| Covid crashDec 2019 – Mar 2020 | −12.6% | −19.1% | +6.5% |
| 2022 inflation and rate risesDec 2021 – Sep 2022 | −13.2% | −12.8% | −0.5% |
Every calendar year
Lighter bars: year not complete in this period.
Table of yearly returnsShowHide
| Year | Portfolio | VWCE | Difference |
|---|---|---|---|
| 2026(partial) | +13.8% | +17.5% | −3.7% |
| 2025 | +5.8% | +9.2% | −3.4% |
| 2024 | +24.1% | +24.4% | −0.4% |
| 2023 | +20.1% | +18.2% | +2.0% |
| 2022 | −15.6% | −13.5% | −2.1% |
| 2021 | +28.1% | +28.6% | −0.6% |
| 2020 | +8.8% | +5.4% | +3.5% |
| 2019(partial) | +5.7% | +8.0% | −2.4% |
Every month
| Year | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec | Year |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2026 | 0.1 | 0.5 | −3.1 | 6.5 | 1.2 | 5.2 | −1.7 | 1.9 | 1.5 | 1.3 | +13.8%* | ||
| 2025 | 3.0 | −2.4 | −7.0 | −3.1 | 5.2 | −0.1 | 5.5 | −0.5 | 2.4 | 3.9 | −0.5 | −0.0 | +5.8% |
| 2024 | 3.3 | 2.8 | 3.2 | −2.0 | 1.2 | 5.2 | −0.1 | −0.3 | 1.4 | 1.1 | 6.6 | −0.4 | +24.1% |
| 2023 | 4.7 | 0.5 | −0.9 | 0.0 | 5.5 | 3.2 | 1.9 | −0.3 | −1.8 | −2.9 | 5.5 | 3.5 | +20.1% |
| 2022 | −5.2 | −1.9 | 3.7 | −3.3 | −3.2 | −5.3 | 9.2 | −2.2 | −5.1 | 3.1 | −0.2 | −5.4 | −15.6% |
| 2021 | 0.6 | 1.9 | 4.9 | 1.9 | −0.7 | 4.6 | 2.0 | 2.8 | −1.9 | 4.6 | 1.4 | 3.2 | +28.1% |
| 2020 | 1.6 | −6.8 | −7.7 | 8.3 | 1.9 | 1.9 | 0.4 | 5.1 | −1.2 | −2.0 | 7.0 | 1.5 | +8.8% |
| 2019 | −1.0 | 2.2 | −0.0 | 3.8 | 0.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.
| Holding period | Worst | Median | Best | Ended with a loss | |
|---|---|---|---|---|---|
| 1 year76 periods | Your portfolio | −15.6% | +11.9% | +34.0% | 13% |
| VWCE | −13.5% | +13.7% | +43.2% | 14% | |
| 3 years52 periods | Your portfolio | +5.6% | +10.3% | +17.7% | 0% |
| VWCE | +5.4% | +11.3% | +20.5% | 0% | |
| 5 years28 periods | Your portfolio | +9.1% | +11.2% | +13.4% | 0% |
| VWCE | +10.1% | +12.1% | +15.1% | 0% |
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.
| Holding | Share of the money | Share of the risk | Money vs risk | Return a year | Volatility | Worst fall |
|---|---|---|---|---|---|---|
| SWDA | 50% | 58% | +13.4% | 14.0% | −18.6% | |
| CSSPX | 20% | 24% | +15.1% | 14.9% | −17.7% | |
| EQQQ | 10% | 15% | +19.8% | 19.3% | −30.5% | |
| AGGH | 20% | 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 portfolio | 100% MSCI World | |
|---|---|---|
| Annual return | 11.9% | 13.7% |
| Volatility | 12.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 high | 24 months | 24 months |
| Sharpe ratio | 0.89 | 0.90 |
| Sortino ratio | 1.52 | 1.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
| Holding | Weight | Share of risk | Correlation with the portfolio |
|---|---|---|---|
| SWDA.MI | 50% | 57.8% | 0.99 |
| CSSPX.MI | 20% | 24.3% | 0.98 |
| EQQQ.MI | 10% | 14.7% | 0.92 |
| AGGH.MI | 20% | 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
- 1Import the positions. Connect Interactive Brokers on the Portfolio page and check the tickers.
- 2Open the analysis. Analyze fills the portfolio analyzer with the imported weights.
- 3Set the assumptions. Period, rebalancing frequency, transaction costs and a benchmark. Defaults are sensible; change one at a time to see what matters.
- 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).
- 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] 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] 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] 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.