I have done the same thing, but and even trickier question is this:
You buy a foreign stock with that stock's native currency you have held in the account for several months previous. You then sell that stock, sit for a while flat (Still holding the currency) Invest in another foreign, sell...