This article describes in a simple and straightforward way how someone can be protected against currency fluctuations in case he/she has opened a position in a foreign asset (asset denominated in another currency).
Suppose that you are a US citizen and you have bought 500 shares of Toyota motor in the Japanese stock exchange. Each one share has cost you 5,000 JPY (Japanese yen). The total value of the position is 5,000/share x 500 shares = 2,500,000 JPY. By buying the shares, you indirectly selling US dollars and buying Yen (you can buy Japanese stocks only if you pay in yen just like you can buy US stocks only if you pay in US dollar). So, you practically have an indirect short position in the USD/JPY currency pair with value 2,500,000 JPY.
In that case your portfolio will lose money if there is a devaluation of yen relatively to the US dollar no matter what the long position in Toyota stock will do. If you have bought the stock only to profit from its price appreciation then you want to neutralize currency fluctuations and the adherent danger.
In order to hedge the above stock position against currency fluctuations you must simultaneously open a direct long position in USD/JPY pair via your trading platform (the reverse position than the one indirectly made when you bought the Japanese stock). The value of the long USD/JPY position must be equivalent to 2,500,000 JPY. If the exchange rate of USD/JPY is 98.00 then this amount equals to $25,510 (this is also the value of your stock position in US dollars).
The above hedge neutralizes foreign exchange fluctuations because when your indirect short USD/JPY position is losing, the direct long USD/JPY position is profiting by the same amount and vice versa.
Of course when you decide to sell the Japanese stock you must again close simultaneously the direct long USD/JPY position and the trade is over. By performing this hedge all you have to worry about is the stock price and not the currency fluctuations.
Notice also that the above example doesn’t incorporate the effect of rollover in the direct forex position (for a retail account and for relatively short periods of time this effect is insignificant).