FIFO, capital gains and loss carryforward
How Cuéntamo prepares your investments for the IRPF return
FIFO: First In, First Out
Spanish tax law mandates capital gains computation in chronological order: oldest units leave the position first. Cuéntamo keeps an internal lot ledger (one entry per buy) and consumes FIFO at every sell. The result lands in each sell's Realized gain field.
The Tax tab shows every figure in euros. If the security trades in another currency, the gain is computed in that currency and the difference is converted to euros at the rate on the sale date, which is the Spanish tax authority's criterion (rulings V1740-17 and V0152-26). It uses the rate your broker applied when the file includes it (DeGiro, for instance) and otherwise the European Central Bank's rate for that day. If something is missing to do it right, the tab tells you at the top which operation to check.
Loss carryforward (4 years)
If a year ends with a loss, you can offset that amount against gains in the next 4 fiscal years. The Tax tab walks through your years one by one: whatever was offset one year isn't subtracted again the next, and anything older than four years expires. It also offsets against dividends and interest: losses can reduce them by up to 25 %, and the other way round. In Bizkaia, Gipuzkoa and Álava that cross-offset doesn't exist: losses only offset gains and income only offsets income. Navarre works like the common regime. Cuéntamo applies the rule of your book's tax residence.
Wash-sale rule
If you sell at a loss and buy the same security within the two months before or after the sale, that loss doesn't count that year (art. 33.5 of the Spanish IRPF Act). It isn't lost: it's deferred until you sell the repurchased units. The Tax tab does that calculation following the Spanish Tax Agency's procedure. It looks at the same security across all your brokers, defers only the part of the loss that matches the repurchased units and adds it back when you finally sell them. You'll also see a warning when you save such a sale, but nothing is blocked.
The two months apply to securities listed on an EU regulated market (Spanish exchange, Euronext, Xetra…). Those listed outside the EU and those that are not listed (unlisted shares, or SICAVs and SOCIMIs on BME Growth) have a one-year window. For the US stock market, the Spanish Directorate General for Taxation has confirmed it (ruling V0896-23). What counts is the market, not the company's country.
You choose it on the position, under «Where is this security listed?». By default it's automatic: one year if the ISIN is from the US and two months otherwise. Change it if your security is listed outside the EU (UK, Switzerland, Japan…) or if it's a US company admitted to a European regulated market.
Traditional investment funds (not ETFs): two months are applied automatically, but it isn't settled that this is right. The law sets one year for units that aren't listed and a fund isn't listed, but the Spanish Directorate General for Taxation hasn't ruled on funds. You'll see a warning on the position and, if you buy back between two months and a year, in the Tax tab report. If you'd rather be on the safe side, choose «Not listed».
For Spanish tax, «oldest first» applies to everything you own, not to each broker separately (art. 37.2 of the IRPF Act). If you hold the same security at two brokers and sell at one, the Tax tab treats the oldest units as sold, wherever they are. That's why its gain may differ from the one you see on the position. In a shared book, each account holder is a separate taxpayer.
Cryptocurrencies. For Spanish tax they aren't securities. Each purchase is converted to euros at that day's rate and the sale at the euros you get, as the Tax Agency's manual says. The two-month repurchase rule is only written for them in Bizkaia, Gipuzkoa and Álava, from 2025. Elsewhere, if you sell at a loss and buy back within the following year, Cuéntamo counts the full loss and warns you, because the tax authority hasn't said whether it's deferred. Trade Republic and Habeas crypto is recognised automatically; if one isn't, tick «This is a cryptocurrency» on the position.
Capital income
Cashed dividends (with their 19 % withholding) and the net yield from fixed-income products matured during the year are aggregated under Capital income. The withholding already collected is subtracted from the IRPF cuota: you only declare the gross amount.