12.3. Automatically Recording Currency Transactions using Trading Accounts

Trading accounts were introduced as a feature from GnuCash version 2.3.14. The conceptual basis for trading accounts is described in Tutorial on multiple currency accounting by Peter Selinger. A second tutorial Multiple currency accounting in GnuCash describes the manual creation and use of trading accounts in GnuCash prior to version 2.3.14.

Trading accounts are not enabled by default in GnuCash. To enable them go to FileProperties+Accounts tab and check the Use Trading Accounts checkbox.

12.3.1. Trading Account Concepts

In accounting terms, trading accounts are specialized equity accounts to record changes in income which result from transactions between two or more currencies. In GnuCash they are implemented as a top level account type of Trading. When trading accounts are enabled the required sub accounts of Trading are automatically created if they do not already exist when a transaction between one or more currencies is created.

In the extended Accounting Equation, Trading accounts would appear as follows:

Equation 12.1. 

Assets = Liabilities + Equity (+ Income -Expenses) + Trading


The user is prevented from manually making entries directly to the registers for any of the accounts in the Trading top level account group. All entries to these accounts are automatically generated when transactions between currencies are created in other account registers within the GnuCash account hierarchy.

The Trading account group is structured below the top level account Trading with a sub-account CURRENCY which in turn has a sub-account for each currency between which transactions have been made. For the example previously used in Section 12.2, “Manually Recording Currency Transaction”, the additional accounts which will be created automatically when transactions are created between different currencies with trading accounts enabled are:


The names of these accounts are again assigned automatically and cannot be changed by a user without disrupting the functionality of the trading accounts in GnuCash.

12.3.2. Recording Foreign Currency Transactions with Trading Accounts Setup of Accounts for Trading Accounts

The same account structure used in the manual recording of currency transactions in the previous section is required. The initial account configuration for Assets and Equity accounts are as follows:

Initial multi currency Account Bank Setup

Initial setup of bank accounts in multiple currencies.

The following prices were entered in the Price Database ( ToolsPrice Database ) as at Jan. 1, 2020 to convert the account balances for the foreign currency accounts to USD:

The Price Database initial entries

Price Database window after setting initial exchange rates between USD, HKD and EUR.

With the currency prices set as shown, the Accounts tab will now display the values of the foreign accounts in USD in the Total(USD) column:

Initial multi currency setup after entering exchange rates between USD, HKD and EUR

Accounts tab after setting exchange rates to USD. Transfer of Funds to a Foreign Currency

Let us assume we wish to purchase at item in Hong Kong using the Hong Kong bank account for 20,000 HKD on Feb. 1, 2020. The current funds in the Hong Kong account are insufficient and we will need to transfer another 10,200 HKD from the US bank account. The exchange rate at the time of the transfer is 1 USD = 7.7884 HKD and we will have to transfer 1,309.64 USD for which the bank charges a 40 USD transfer fee. The transaction to effect this is created with the Transfer Funds dialog as shown below:

Transfer dialog to create transactionfor transfer from USD to HKD

Transfer of 10,200 HKD from US Bank account to Hong Kong bank account.

The Debit Amount has been specified in HKD and the transaction Amount being transferred in USD. There is no provision to enter the transfer fee in the dialog. On closing the dialog the following transaction as viewed in the US Bank Account register has been created:


Amount entered in the Transfer Funds are transferred from the selected Credit Account to the selected Debit Account. And if Debit Amount radio button is selected and the foreign currency amounts are entered, the transaction is recorded on the correct debit amounts. Whereas if Exchange Rate is selected and entered, the exact value is not often recorded due to the rounding errors.

Transaction after transfer displayed in US Bank account register

Transaction to transfer from US bank account to Hong Kong Bank account after closing transfer dialog.

The transaction can be opened in the US Bank Account register and may then be edited to add splits for the transfer fee as follows:

Transaction after adding the splits for the transfer fee

Transaction to transfer from US bank account to Hong Kong Bank account after adding the splits for the transaction fee.

Returning to the Accounts tab we can see the result of the transfer transaction on the accounts:

Account tab balances after completion of USD to HKD transfer

Account balances in the Accounts tab after the transfer of funds from the US Bank account to the Hong Kong bank account.

The balances of the Asset and Equity accounts are presented with values set by the exchange rate entered in the transaction to transfer funds on Feb. 1, 2020.

The trading accounts have been automatically created and the amounts of the transfer have been entered into the accounts. There are no entries associated with the pre-existing opening balances of the accounts prior to the transfer. This reflects that the trading accounts only reflect gains and losses since the book was opened.

At this point there have been no trading gains or losses. The balances of the USD and HKD trading accounts are the same when converted to USD. The HKD trading account has a debit (negative balance) and the USD trading account has a credit balance (positive balance). The net balance of the CURRENCY sub account of Trading, and Trading itself, is 0 indicating that at this point no gains or losses have been recorded in the trading of currencies.

The hypothetical purchase in Hong Kong fails to take place and a month later on Mar. 1, 2020 the funds are required in the US account for another purpose. A transfer of 10,200.00 HKD is made from the Hong Kong bank account back to the US bank account. The exchange rate at the time of the transfer is 1 USD = 7.7933 HKD and a fee of 20.00 USD is charged for the transfer. The transaction to effect the transfer is as follows:

Transaction to transfer funds from Hong Kong to US Bank account.

The transaction transfers 10,200.00 HKD from the Hong Kong Bank account to the US Bank account.

After transferring the funds back to the US Bank account, the prices database entries are as follows:

Price database after transfer of funds back to US account

The price database showing prices for the transfer of funds to HKD and back to USD.

The Accounts tab balances after transferring the funds back are as follows:

Accounts tab after transfer back

State of the accounts after the funds have been transferred back.

The Assets and Equity balances now reflect the the values of the accounts at the exchange rate for the transfer of funds back to the US Bank account. The Trading and CURRENCY placeholder accounts now indicate a modest realized loss of 0.82 USD on the currency transactions. The associated transfer fees appear in the Expenses total. Not a profitable exercise but still illustrative.


The gains or losses reported using trading accounts are realized gains and losses.

Finally we have the balance sheet after the above sequence of transactions reporting the Trading Loss incurred:

Balance sheet after above transactions

Balance Sheet after these transactions reflecting the trading loss incurred.