If you are calculating your capital gains, keep in mind that the US and Spain have different wash sale rules (in Spanish it's called antiaplicación). A wash sale is when you sell a stock or mutual fund and buy back a substantially similar one within some period of time.

In the US, if you sell a stock at a loss and buy back a substantially similar stock (or a contract to do so), you don't count this is a sale, but add this to the cost basis of the new shares instead. The rule doesn't apply for gains.

In Spain, the rule applies for two months, but you need to declare the loss in a special box that can be used later on when you sell the shares.

So in theory something could be a wash sale in the US, but not in Spain, either because of timing or because of currency movement.

Spain also has the idea where you can buy and sell mutual funds in the same family without triggering any capital gains. However, these funds have to be Spanish based or held by a Spanish broker.