If someone opens an account on Interactive brokers where you can trade in multiple markets with multiple currencies then new questions arise. Let us assume that until now your trades was in your local currency, e.g., in HUF, Hungarian forint. Now you would like to buy ETF-A using USD. You would like to know your capital gain in HUF, which will depend on the price change of ETF-A and the change of the USD-HUF exchange rate. How should you handle the currency change, how should you account buying and selling for another currency, what about expenditures in foreign currency? The following case study shows the answers for these questions.
Step 1
You transfer 10 000 HUF to your new account.
Balance: 10 000 HUF
Step 2, buying foreign currency
You buy 1 USD for 330 HUF. For simplicity now we assume that there is no conversion fee, and you can exchange at mid-price.
The USD can be treated as an instrument, so an opening transaction must be created.
Balance: 9 670 HUF, 1 USD, 1 USD = 330 HUF, total value: 10 000 HUF.
Step 3, selling foreign currency
One day has passed, you sell 1 USD for 340 HUF.
You has to create a closing transaction. Consequently you will have 10 HUF realized profit coming from the change of the exchange rate.
Balance: 10 010 HUF, 0 USD, 1 USD = 340 HUF, total value: 10 010 HUF.
Step 4
Another day has passed and you buy 1 USD for 330 HUF.
A new opening transaction must be created.
Balance: 9 680 HUF, 1 USD, 1 USD = 330 HUF, total value: 10 010 HUF.
Step 5, expenditure in foreign currency
One day has passed, the exchange rate is 340 HUF and you have a 1 USD expenditure.
You can create an expenditure in instrument which is the closing of the opening transaction of the previous step. The alternative is to close the opening transaction normally as if you would have sold the USD and create an additional expenditure transaction of 340 HUF. In either case there will be 10 HUF realized profit and 340 HUF worth of expenditure.
Balance: 9 680 HUF, 0 USD, 1 USD = 340 HUF, total value: 9 680 HUF.
Step 6, income in foreign currency
You have 1 USD income, the exchange rate is 330 HUF.
A new opening transaction must be created which is an "income in instrument".
Balance: 9 680 HUF, 1 USD, 1 USD = 330 HUF, total value: 10 010 HUF.
Step 7
One day has passed, you sell 1 USD for 320 HUF.
You have to create a closing transaction. Consequently you will have 10 HUF realized loss coming from the change of the exchange rate.
Balance: 10 000 HUF, 0 USD, 1 USD = 320 HUF, total value: 10 000 HUF.
Step 8, buying for foreign currency
You buy 1 ETF-A for 10 USD. 1 USD = 330 HUF.
Create an opening transaction for buying the 1 ETF-A, the opening price is 10 * 330 = 3 300 HUF.
Actually, you have to buy 10 USD before buying the ETF-A. You can account this buy as well by creating an opening transaction for buying the 10 USD and then creating a closing transaction for selling the 10 USD. These two transaction does not change your HUF level so you can omit them.
At this moment Lc assumes that all opening transaction is in the base currency which is HUF in this example. In the future, it would be nice to create a transaction where we can buy 1 ETF-A for 10 USD. In general we could say that we buy x instrument-A for y instrument-B.
Balance: 6 700 HUF, 0 USD, 1 ETF-A, 1 USD = 330 HUF, 1 ETF-A = 3 300 HUF, total value: 10 000 HUF.
Step 9
One day has passed, today 1 USD = 340 HUF, 1 ETF-A = 10 USD.
Only the exchange rate of the USD has changed, the price of ETF-A in USD is the same. Consequently the price of ETF-A in HUF is 3 400. S you have 100 HUF unrealized gain. You can write the 3 400 HUF into the historical prices tab. Notice that here all prices must be in the base currency, which is HUF at this example.
Balance: 6 700 HUF, 0 USD, 1 ETF-A, 1 USD = 340 HUF, 1 ETF-A = 10 USD, total value: 10 100 HUF.
Step 10, selling for foreign currency
One day has passed, today 1 USD = 340 HUF, 1 ETF-A = 9 USD.
The exchange rate of the USD has not changed, but the price of ETF-A has dropped to 9 USD. Consequently the price of ETF-A in HUF is 3 060. You decide to sell ETF-A, so you realize 240 HUF loss (compared to step 8 which is the opening).
You have to create a closing transaction where the closing price is 3 060 HUF. This will increase your HUF level but you get USD. So, at the same time you have to create an opening transaction for buying 9 USD. This is important because you can have capital gain on the USD as well.
Keep in mind that the closing of the ETF-A transaction and the opening of the USD transaction must change together. For example, if you realize that the exchange rate is actually 341 then both of the mentioned transactions must be changed. At the moment Lc does not check or force this.
Balance: 6 700 HUF, 9 USD, 0 ETF-A, 1 USD = 340 HUF, 1 ETF-A = 9 USD, total value: 9 760 HUF.
Step 11, buying for foreign currency when the exchange rate has already changed
One day has passed, today 1 USD = 350 HUF, 1 ETF-B = 2 USD.
You decided to buy 1 ETF-B, its price is 2 USD. You have a single batch of USD which must be split, 9 = 7 + 2. Remember there is a button in Lc to do this. Next, you has to close the 2 USD batch. You will have 20 HUF realized gain. Your total value has increased by 90 HUF because you have an additional 70 HUF unrealized gain. Next, you create an opening transaction ETF-B, the opening price is 2 * 350 = 700 HUF.
Every time if you have to spend x USD but you only have a bigger batch with size n then you can split the existing bigger batch. Originally you had one opening transaction with amount n, then you will have two openings with amount x and n - x. If you have several small batches then you can merge them by closing them and opening one big summarized batch.
Balance: 6 700 HUF, 7 USD, 1 ETF-B, 1 USD = 350 HUF, 1 ETF-B = 2 USD, total value: 9 850 HUF.
Download this Scutum ledger to see this case study. Notice that the transactions always happens at midnight but the period bounds are at 1:00 am (see the Dates tab), so it is clear to which period a transaction belongs to. (If a transaction is on the period boundary, it will be included in the right-hand period.)