Term
BacktestingAdvanced
ENIT

Capital-gains tax

UPDATED 2026-09-24

Capital-gains tax is the tax charged on a realized gain — the profit you make when you sell a position for more than you paid for it. It applies only to gains you have actually locked in by closing a position, not to paper gains on holdings you still own. Crucially, it is charged on your net result rather than on each winning trade in isolation: realized losses are set against realized gains, and what is left over carries forward to later years. Fincanva can model the tax with two rates, a short-term and a long-term one chosen by how long the position was held, but whether that split exists at all is decided by your tax residency — Italy taxes a realized gain at one rate however long it was held.

Also seen as: CGT, tax on realized gains

How is capital-gains tax calculated?

Capital-gains tax is the applicable rate multiplied by the taxable gain — and the taxable gain is your realized gains after realized losses have been set against them, not each winning position on its own.

taxable gain=realized gains−realized losses set against them\text{taxable gain} = \text{realized gains} - \text{realized losses set against them} tax=applicable rate×taxable gain\text{tax} = \text{applicable rate} \times \text{taxable gain}

where: realized gains and realized losses are the profits and losses locked in by positions closed during the year, and the losses that may be set against a gain include losses carried forward from earlier years, under the limits in the next section. The applicable rate is the short-term or the long-term rate, decided by your tax residency and by how long the position was held. A year whose losses exceed its gains has a taxable gain of zero and carries the remainder forward; it is never a negative tax.

This is the difference that changes what a backtest shows you. A strategy that closed one position for +1,000 and another for −400 in the same year is taxed on 600, not on 1,000. Reading the rate against gross gains overstates the drag that taxes put on a strategy — often substantially, for a strategy that trades a lot.

Where the residency has both rates, a position sold after only a brief holding period meets the short-term rate and one held longer meets the long-term rate. The app labels the two fields "Short-term capital gains" and "Long-term capital gains".

How long must a position be held to count as long-term?

More than one year — more than 365 days between opening and closing the position. A position held for exactly 365 days is still short-term; it has to pass the threshold, not merely reach it.

The clock starts when the position is first opened. Buying more of an instrument you already hold does not restart it, and selling part of a position is measured from that same first purchase — the clock only resets once the position has been closed completely.

The threshold only does anything under the residencies that have two rates: United States and Other. Under Italy there is no short/long split at all, so the holding period does not change the rate — see tax residency for which rates each residency starts from and which of them you can edit.

What happens to a realized loss?

A realized loss reduces the gains you are taxed on, and any part of it you cannot use this year is carried forward. How long it stays usable, and against what, depends on your residency — and the Italian rules carry an asymmetry that is easy to be caught by.

Under United States and Other residency:

  • A loss is first set against gains realized in the same year — and within the year the character does not matter: a short-term loss can reduce a long-term gain, and a long-term loss a short-term gain.
  • Whatever is left over at the end of the year carries forward with no time limit — it stays available for as many years as the backtest runs.
  • A carried loss keeps its short-term or long-term character: a carried short-term loss reduces short-term gains, and a carried long-term loss reduces long-term gains. It does not cross over.
  • Fincanva does not model the annual deduction of net capital losses against ordinary income that US tax law allows. In a simulation, a loss is only ever useful against capital gains.

Under Italy residency:

  • Losses stay usable for five years, after which an unused loss simply stops being available. The tax regime you select decides how that window is counted:
    • Declarative — the year is settled as a whole: the year's losses are first set against the same year's gains, and a net loss for the year can reduce net gains in the five years that follow.
    • Administered — each gain is settled as it is realized: a loss can reduce gains realized after it, in the year it was realized and the four years that follow. A gain already taxed before the loss happened is not revisited.
  • There is a single rate, so there is no character to preserve — a carried loss reduces any compensable gain.
  • A gain on an ETF cannot be reduced by any loss — from the same year or carried forward — but a loss on an ETF can be used to reduce other gains. The asymmetry runs one way only.

Why the Italian ETF rule matters to your results

If you are modelling a portfolio built mainly of ETFs under Italian residency, your losses help you and your gains do not. Every ETF gain is taxed in full, whatever losses you have realized that year or are carrying; every ETF loss still goes into the pool that reduces your other, non-ETF gains. A portfolio of nothing but ETFs therefore gets no benefit from netting at all on the gains side, even in a year that also produced large losses.

This applies to instruments Fincanva classifies as ETFs. Other exchange-traded products — ETNs, ETCs, closed-end funds — are treated as ordinary compensable instruments in the model, so their gains can be reduced by carried losses.

How does Fincanva handle it?

  • The rates are percentages of the gain and are seeded from your tax residency, which is also what decides whether a short/long split exists at all — that page carries the per-residency table and says which fields you can still edit.
  • Tax is charged only on realized gains, and only when taxes are switched on in your simulation assumptions; with taxes off it is zero. With taxes on, the value a run reports each day also sets aside the tax its still-open gains would owe if sold that day — see taxes toggle.
  • The rate is applied in full: the tax charged is the applicable rate on the taxable gain.
  • When the tax leaves the account follows the tax regime: once a year, on the year's net result, under United States, Other and the Italian Declarative regime; as each gain is realized under the Italian Administered regime.
  • For Italian residency the rates are set by tax law for the selected tax regime and shown as "Auto-updated" rather than edited by hand.

What does it look like in practice?

A strategy closes two positions in the same year: one for a 1,000 gain, held eighteen months, and one for a 400 loss.

Under United States residency the loss is set against the gain first, so the taxable gain is 1,000 − 400 = 600, not 1,000. The winner was held more than a year, so it is long-term and meets the 20% rate: 20% × 600 = 120 of tax. Close the same winner at eleven months instead and nothing about the netting changes — the taxable gain is still 600 — but it is now short-term and meets the 35% rate: 35% × 600 = 210 of tax. The holding period moved the bill by 90 on an unchanged pair of trades.

Now give the strategy a 1,400 loss, on a position held only a few months, instead of a 400 one. Losses exceed gains, so the taxable gain is zero and the tax is 0. The short-term loss has wiped out the long-term gain within the year, and the unused 400 carries forward as a short-term loss — the character of the loss it came from — still available against short-term gains in any later year of the run.

Run the same pair under Italy residency, on the default Declarative regime, and two things change. The single 26% rate applies whatever the holding period was, so both versions give 26% × 600 = 156 of tax. And if the winner was an ETF, the netting does not happen on that side at all: the 1,000 ETF gain is taxed in full, 26% × 1,000 = 260 of tax, while the 400 loss is not wasted — it stays available against any non-ETF gains the strategy made. Same two trades, same rate, 104 more tax, purely because of what the winner was. Under the Administered regime the order of the two trades matters too: if the winner closed first, its 1,000 was taxed when it was realized, and the later 400 loss is carried forward for future gains instead.

These figures describe the tax base Fincanva models in a simulation, not tax advice for your own situation — see Is this financial advice?.

Used in 6 pages

Fincanva is for education and illustration only. It is not personalised financial advice, and past or simulated results do not predict future ones. Read the Terms Addendum

GLOSSARY · 222 TERMS