If you’re tax resident in Spain and trade CFDs (including CFDs on gold) or forex, by hand or with a robot, what you make or lose goes into your IRPF (Impuesto sobre la Renta de las Personas Físicas, Spain’s personal income tax) as capital gains and losses (ganancias y pérdidas patrimoniales) and is taxed in the savings income tax base (base del ahorro) at 19% to 30%. Nobody withholds anything along the way: you report it yourself. Here’s what counts, where it goes in Renta WEB, the official online filing service, when the overseas assets return (modelo 720) comes in, and a worked example for the 2026 tax return, the one filed in 2027, normally between April and June.
This guide summarizes Spain’s national IRPF rules in force on November 3, 2026, for Spanish tax residents. If you moved to Spain under the special regime of article 93 of the IRPF Act (Ley del IRPF), the “Beckham Law”, you’re taxed under different rules that this guide doesn’t cover: check with an advisor. The rules, the criteria of Hacienda, the Spanish Tax Agency (Agencia Tributaria, or AEAT), and the boxes on the form change, and your case may have nuances that don’t fit here. Before you file your return, talk to a tax advisor or the Tax Agency.
- How CFDs, forex and gold are taxed in Spain
- How much you pay on trading gains: the 2026 savings rates
- Losses: how they’re offset and for how long
- Commissions, swaps and the two-month rule
- Where the figures come from: Spanish or foreign broker
- Where it goes in Renta WEB
- A worked example with round numbers
- Foreign broker: when you have to file Modelo 720
- Is it a business activity? And the robot subscription?
- What happens if you don’t report your trading
- AUREUM and your tax return
- Frequently asked questions about trading taxes in Spain
How CFDs, forex and gold are taxed in Spain
A CFD, or contract for difference, is an agreement with your broker to receive or pay the difference in an asset’s price between opening and closing the trade, without ever buying the asset; the CNMV, Spain’s securities regulator, describes them as high-risk leveraged products. At MetaTrader 5 brokers, XAU/USD is usually a CFD on spot gold (how margin works is explained in gold leverage).
For Hacienda, the result is a capital gain or loss in the savings income tax base. The Directorate General for Taxation (Dirección General de Tributos, DGT) said so in binding ruling (consulta vinculante) V0597-18, on CFDs on indices and shares and on currency contracts (forex): the margin is only collateral, you don’t buy or sell the asset, and what’s taxed is the difference between the opening and closing price. Binding rulings are written answers from the DGT whose criteria Hacienda must apply to identical cases.
What about gold? A CFD on gold is just another CFD: you don’t own the metal, only the contract. We haven’t found any rule that treats it differently, and when the DGT describes CFDs, it includes those on any asset with a market price (V2770-19). Physical gold, funds and ETCs have their own rules, and we don’t cover them here.
- What’s taxed is what’s settled in the year: a gain is allocated to the year in which the change in your assets (alteración patrimonial) takes place (article 14.1.c of the IRPF Act), which for a CFD, according to the DGT, is when the right to receive the settlement or the obligation to pay it arises (V0597-18). Normally that means closed trades, including those your broker closes in a stop out; if your broker settles open positions every day, with a credit or debit to your account, what has been settled on positions still open on December 31 counts too (V2115-21).
- Withdrawing money isn’t making money. Deposits and withdrawals aren’t taxed: what counts is the result of your trades (if your account is in dollars, see below for which exchange rate to use).
- Nobody withholds. The IRPF regulations only provide for withholding on a few kinds of gains, such as those from investment funds, and CFDs aren’t among them.
Who this applies to: only Spanish tax residents, generally people who spend more than 183 days a year in Spain or whose main economic interests are here. If you live in another country, its rules apply. If you used to spread bet in the UK, the UK tax treatment doesn’t carry over: as a Spanish resident you’re taxed under Spanish rules on your income wherever it arises (article 2 of the IRPF Act), and we haven’t found a DGT ruling on spread betting specifically. And within Spain, the Basque Country and Navarre have their own IRPF: if you live there, check their rules.
How much you pay on trading gains: the 2026 savings rates
The savings income tax base is, roughly, what your investments leave you with over the year: gains minus losses, plus interest and dividends. It’s taxed in brackets: each slice of the gain pays its own rate, not all of it at the top rate. The table adds up the national and regional scales, which are the same in every region under the common system:
| Bracket of the savings base | Rate |
|---|---|
| Up to €6,000 | 19% |
| €6,000–50,000 | 21% |
| €50,000–200,000 | 23% |
| €200,000–300,000 | 27% |
| Over €300,000 | 30% |
What’s changed: the top bracket went up from 28% to 30% in 2025, under Law 7/2024. For 2026 we haven’t found any changes to the IRPF rules this guide uses: we checked the consolidated text of the IRPF Act in the BOE, Spain’s official gazette, in its latest update, of October 7, 2026.
One nuance: the personal allowance (mínimo personal), the part of your income that isn’t taxed, is applied first to the general tax base. If you have a salary, it’s normally used up there, and your trading gain is taxed from the first euro.
Losses: how they’re offset and for how long
Within the year, all your capital gains and losses from transfers are added together, those from CFDs with those from shares, funds or crypto: what you lose on gold reduces what you make on the stock market. If the balance is negative (article 49 of the IRPF Act):
- You offset up to 25% of your investment income for the same year: interest and dividends.
- Whatever is still negative is offset over the next four years, by as much as each year allows.
- It also works the other way round: if interest and dividends come out negative, they offset up to 25% of your gains.
For example, you end 2026 with −€1,000 on CFDs and earn €2,000 in interest on a deposit. You offset €500 (25% of €2,000) and are left with −€500 to offset until 2030. That’s why it’s worth reporting your bad years too: each year Renta WEB records those losses as saldos netos negativos (net negative balances) pending offset.
Commissions, swaps and the two-month rule
Not everything you see in your history counts the same way. According to the DGT’s rulings:
- Opening and closing commissions: they count. They’re costs inherent to the trade and reduce the gain or increase the loss (V0597-18).
- Spread: already included. It’s built into the entry and exit prices, so it’s already part of the result (what each cost is, in commissions and swap).
- Swap: it depends. On CFDs on indices and shares, the DGT says that the interest you pay to hold a position overnight doesn’t reduce the gain, because it’s a financing cost (V0597-18 and V2115-21), and that the interest you receive does add to it (V2115-21). On currency contracts, the daily swap counts both ways (V0597-18, which follows the criterion of V1342-14). For a gold CFD we haven’t found an express criterion: in the example we don’t deduct the swap paid, as with CFDs on indices and shares. It’s the cautious option, and a good question for your advisor.
The two-month rule
If you sell shares or other listed securities at a loss and buy identical securities in the two months before or after the sale, the loss is deferred until you sell those securities (article 33.5.f of the IRPF Act). That doesn’t happen with CFDs: the DGT has said they aren’t securities or assets that are sold and bought back, so neither that rule nor the one-year rule for other assets applies to them (V2770-19, repeated in V2115-21). If you close at a loss and reopen, the loss counts that year.
Where the figures come from: Spanish or foreign broker
Many Spanish brokers provide an annual tax report. If yours doesn’t, or it’s a foreign broker (the usual case with MetaTrader 5), you take the figures from the annual statement or the account history. In MT5:
- Open the Toolbox (Ctrl+T) and go to the History tab.
- Right-click to choose the Positions view and a period from January 1 to December 31.
- Right-click the table header and turn on the Commission and Swap columns; the summary row adds up profit, commissions and swaps.
- Right-click and choose Report to save it as HTML or as a spreadsheet (we explain it in how to see what you really paid in MT5).
Two warnings. MT5 shows the broker’s server time, not Spanish time (gold trading hours and server time): check the trades on the night of December 31. And if your account is in dollars or another currency, your return is still in euros: the DGT says each result is converted into euros at the official exchange rate for the day it occurs, which is the one published by the European Central Bank (binding ruling V1342-14, on a forex account in US dollars, based on article 36 of Law 46/1998). The currency in the account can also produce exchange gains or losses when you convert or spend it (article 14.2.e of the IRPF Act): best to go over that with your advisor. Keep your broker’s official statements for as long as Hacienda can review the year (article 104 of the IRPF Act).
Where it goes in Renta WEB
Renta WEB has no section of its own for CFDs, and the Tax Agency doesn’t mention them in the form for the 2025 tax year, the latest published. By elimination, they fit in section F2, “Ganancias y pérdidas patrimoniales derivadas de la transmisión de elementos patrimoniales” (capital gains and losses from transfers of assets), in the block for transfers of other assets, with code (clave) 4, “Otros elementos patrimoniales no afectos a actividades económicas” (other assets not used in a business activity). According to the Renta WEB help, that code is for gains or losses from “any other assets or rights not included in the previous sections”, and a CFD isn’t a share, a fund, a crypto-asset or a property. This is our reading, not an instruction from the Tax Agency: confirm it with your advisor or with the Agency itself.
That block used box (casilla) 1626 for the code, 1633 for the transfer value and 1637 for the acquisition value, with the totals in boxes 0386 (gains) and 0385 (losses). The numbers may change: check the 2026 ones when the form is published, before the 2027 filing season (the last one ran from April 8 to June 30, 2026). The form works out the result by subtracting the acquisition value from the transfer value, so that difference has to match your net result. How to split the figures between the two boxes, and whether to enter them trade by trade or grouped, is something to check with your advisor or the Tax Agency.
Do you have to file a return at all? With CFD gains, almost always: the €22,000 salary threshold only exempts people whose income is limited to the kinds the law lists, and CFD gains, which aren’t subject to withholding, aren’t among them. You’re only exempt if all your income together comes to no more than €1,000 a year and your capital losses are under €500 (article 96 of the IRPF Act).
A worked example with round numbers
Laura lives in Madrid, has a salary and in 2026 trades CFDs with a foreign broker, with her account in euros. Her history for the year shows this; the last column says whether each line goes into the tax calculation:
| Item | Amount | Counts? |
|---|---|---|
| Gold CFDs (XAU/USD), closed trades | +€3,000 | Yes |
| Other CFDs (indices) | −€1,000 | Yes |
| Opening and closing commissions | −€120 | Yes |
| Swaps paid on the gold positions | −€180 | No (cautious assumption) |
| Savings base (3,000 − 1,000 − 120) | €1,880 | — |
As her salary already uses up the personal allowance, the €1,880 is taxed at 19%: €357.20. If those swaps were deducted, as on currency contracts, the base would be €1,700 and the tax €323: €34.20 less. With bigger gains, the average rate (the tax divided by the base) rises slowly, because each bracket pays its own rate:
| Savings base | Tax | Average rate |
|---|---|---|
| €1,880 | €357.20 | 19% |
| €10,000 | €1,980 | 19.8% |
| €60,000 | €12,680 | 21.1% |
With €10,000, for example, the first €6,000 pay 19% (€1,140) and the other €4,000 pay 21% (€840). These are our own calculations with the scale in force in 2026, with no other savings income and no deductions.
Foreign broker: when you have to file Modelo 720
Modelo 720 is an informational return: you don’t pay anything with it. If your account is with a broker located outside Spain, the cash account where you deposit margin and where your CFDs are settled counts as an account abroad, according to the DGT (V0813-17); CFDs, futures and forex aren’t reported, because they’re derivatives: they aren’t shares or other securities that have to be reported. If you also hold shares or funds with that broker, they go in a different block of Modelo 720, with its own €50,000 threshold (article 42 ter of Royal Decree 1065/2007).
- When: if, adding up all your accounts abroad, the balance on December 31 or the average balance for the last quarter is over €50,000.
- Deadline: January 1 to March 31 of the following year; for 2026, by March 31, 2027.
- Following years: only if either of those balances rises by more than €20,000 over your last return, or if you stop holding the account.
On January 27, 2022, the Court of Justice of the EU ruled that the consequences of not filing this return or filing it late, fines included, were disproportionate (case C-788/19), and Law 5/2022 abolished that special regime. Today the general regime of the General Tax Act (Ley General Tributaria) applies (articles 198 and 199, according to the Tax Agency’s FAQ on Modelo 720): if you don’t file it, €20 for each piece or set of data, with a minimum of €300 and a maximum of €20,000, and half that if you file late without being asked (article 198). For crypto-assets held in custody outside Spain worth more than €50,000 there’s Modelo 721. And before opening an account abroad, check how the broker is regulated (how to choose a broker for an Expert Advisor).
Is it a business activity? And the robot subscription?
Trading your own money, even if you make lots of trades or use a robot, isn’t usually a business activity (actividad económica). The law requires organizing resources to take part in the production or distribution of goods or services (article 27.1 of the IRPF Act), and in November 2025 the DGT replied that someone who buys and sells crypto with a program that automates the trades, with their own capital and without providing services to third parties, isn’t carrying on a business activity (V2232-25; the DGT assesses it case by case). The ruling is about crypto and we haven’t found an equivalent one on CFDs; since the article of the law is the same, we understand the criterion also applies to a CFD robot, but that’s our reading. It’s a different matter if you manage other people’s money or charge for services, as we explain in is automated trading legal in Spain?
What about expenses? As an individual, you can only deduct the costs inherent to each trade (article 35 of the IRPF Act), those with “a clear and precise link” to it, in the DGT’s words, which is why it refused to let an annual portfolio management fee reduce the gain (V3292-20). Applying that criterion, a subscription to a robot, a VPS or a course, which is paid by period rather than per trade, generally doesn’t reduce your gain. This is our reading: we haven’t found a ruling on an Expert Advisor specifically.
What happens if you don’t report your trading
If you file late on your own initiative, before Hacienda contacts you, you pay the tax with a surcharge and no penalty: 1% plus another 1% for each full month of delay and, after 12 months, 15% plus late-payment interest (article 27 of the General Tax Act). If it’s Hacienda that corrects it, after a formal request or a tax audit, a penalty of 50% to 150% of the unpaid tax, depending on how serious the case is, is added to the tax and interest (article 191). And every year Spain exchanges information on financial accounts with other countries (Royal Decree 1021/2015), so the details of an account with a foreign broker can also reach Hacienda.
AUREUM and your tax return
AUREUM is software that runs a gold strategy in your own MetaTrader 5 account: your money stays in your account. It’s a program, not a fund: we never touch your money, which is held by your broker. The trades and their results are yours, and to report them you use your broker’s statement, just as if you traded by hand. And AUREUM does not constitute financial, investment, tax or legal advice: with your figures in front of you, a tax advisor is the best person to help.
Frequently asked questions about trading taxes in Spain
How are CFDs taxed in Spain?
As capital gains and losses in the savings income tax base of the IRPF, at 19% to 30% in brackets. What’s taxed is the result settled in the year, normally that of closed trades, with opening and closing commissions included, according to the DGT’s binding rulings V0597-18 and V2115-21. We haven’t found different rules for CFDs on gold.
How much tax do you pay on trading gains in Spain in 2026?
19% up to €6,000, 21% from €6,000 to €50,000, 23% up to €200,000, 27% up to €300,000 and 30% above that. Each bracket pays its own rate: if your salary already uses up the personal allowance, a net gain of €10,000 means €1,980 in tax. It’s the 2025 scale, which is still in force; the Basque Country and Navarre have their own IRPF.
Can trading losses be offset?
Yes. They’re deducted from your other capital gains for the year; if the balance is still negative, it offsets up to 25% of your interest and dividends, and whatever is left is carried forward to the next four years. That’s why it’s worth reporting your losing years too.
Do I have to file Modelo 720 if my broker is abroad?
If you only hold CFDs or forex with that broker, you have to file it when the total of your accounts abroad is over €50,000 on December 31 or in the average balance for the last quarter. The broker’s cash account counts; the CFDs themselves aren’t reported. It’s filed from January 1 to March 31; in later years, only if a balance rises by more than €20,000 or you close the account. It doesn’t mean paying more tax.
How do I report a foreign broker on my Spanish tax return?
If you trade CFDs or forex with it, the same way as with a Spanish one: the result goes into the savings income tax base as a capital gain or loss. As it usually won’t give you a Spanish tax report, you take the figures from the statement or the MT5 history, and if the account is in dollars, you convert each result into euros at the European Central Bank’s official exchange rate. Separately, if your accounts outside Spain total more than €50,000, you file Modelo 720, which is for information only.
Does the two-month rule apply to CFDs?
No. The DGT has said CFDs aren’t securities or assets that are sold and bought back, so neither the two-month rule nor the one-year rule for other assets applies to them (rulings V2770-19 and V2115-21). If you close at a loss and reopen, the loss counts that year.
Is a trading robot subscription tax-deductible?
For an individual, generally not. Only costs linked to each trade are deducted, such as opening and closing commissions. The DGT refused to let an annual portfolio management fee, paid by period and regardless of the trades, reduce the gain (V3292-20); we haven’t found a ruling on trading robots, but on that criterion a subscription wouldn’t either. It would be different if your trading were a business activity, which is unusual if you trade your own money.
This article is educational and is not tax, legal or investment advice. It summarizes Spain’s national IRPF rules in force on November 3, 2026; the rules, the Tax Agency’s criteria and the boxes on the form may change, and your situation may have nuances, so talk to a tax advisor or the Tax Agency before you file. The example is our own calculation with round numbers. Leveraged trading carries a high level of risk and you can lose some or all of your capital. Past or simulated results do not guarantee future results.
AUREUM trades in your account, with your broker
Software that trades XAU/USD in your own MetaTrader 5 account: your money stays in your account, and every trade shows up in your broker’s history and statement, just like the ones you open by hand.
See how it works →