Backtest a portfolio switch, including capital gains tax

Before replacing one fund with another, see what the change would have done in the past: to return, to risk, and after the tax a sale would have triggered.

What you can test

  • Adding: stocks, ETFs, German government bonds, US Treasuries or currencies, at any weight, sized in %, shares or euro.
  • Switching: sell all or part of a holding to pay for the new picks; LTP works out the gain from your trades and the tax at the rate you set.
  • When the tax is earned back: the date the new mix would have caught up with the portfolio as it was, if it did.

What it shows

Growth charts rebased to 100, return per year, volatility, maximum drawdown, value-at-risk, Sharpe ratio and beta, for your portfolio, the new mix and each pick alone, plus how risk and return change as the new pick's weight grows. Weekly data since 2015 for about 9,400 European-listed stocks and ETFs.

Selling to buy, with tax: an example

A hypothetical case: you sell a holding worth EUR 20,000 that cost you EUR 15,000. The gain is EUR 5,000; at a tax rate of 26% the tax is EUR 1,300, so EUR 18,700 goes into the new picks. The backtest replays the past with that smaller amount invested in the new mix and shows whether, and from when, it would have caught up with the portfolio you had. LTP works out the gain from your own trades; the rate is the one you set, as a flat rate.

How to set it up

  1. In Selection, press + Add next to each security you are considering; they collect in the Backtest tab.
  2. Choose a baseline: your portfolio, a benchmark, or nothing to test the selection on its own.
  3. Size each pick in %, shares or euro; the baseline keeps the rest.
  4. To switch rather than add money, use Sell from your portfolio and set your tax rate.
  5. Pick the period and read the Change column: green means better.

Reading the figures

Return per year and volatility describe growth and how much it swung; maximum drawdown is the worst fall from a peak; value-at-risk is the loss exceeded in only a small share of weeks; the Sharpe ratio is return above the risk-free rate (set in Portfolio › Settings) per unit of volatility; beta measures how much the mix moved with its benchmark. The last chart shows how return and risk change as the new pick's weight grows from 0%.

Questions

Is this investment or tax advice?

No. It is a simulation on past prices with a flat tax rate you choose; past results do not predict future ones, and real tax depends on your situation.

Can I backtest against a benchmark instead of my portfolio?

Yes: MSCI World, S&P 500, STOXX Europe 600, emerging markets, euro government bonds, or a benchmark you build.

How far back does the data go?

Weekly prices since 2015, for about 9,400 European-listed stocks and ETFs, government bonds and currencies; a security listed later starts later.

Does a good backtest mean the switch will pay off?

No. It shows what would have happened over one past period; markets, costs and tax can all differ in the future.

Open the backtest → Free, no account; your portfolio stays in your browser.

More guides