Adrien:

> Does it accept you changing the Imbalance split accordingly?

No. When I change the account Imbalance-CAD to Trading:CURRENCY:USD in that split, when I save the transaction, GnuCash changes the amount of the Trading:CURRENCY:USD split to zero, and adds another Imbalance-CAD of 800.

> (the two CURRENCY splits should be opposite dr/cr of each other)

My understanding is for each currency, the splits with that currency should sum to zero. I suspect that for this stock-type transaction, GnuCash is treating all the splits as being in the same currency, even though they are not.

In my expected transaction, there are two pairs of matching splits, one for USD & DLR.U, one for CAD & DLR. Each pair of splits affects the fund account and the corresponding TRADING:FUND account, e.g. Buy Brokerage CAD:ETF:DLR, sell Trading:FUND:DLR. No currency changes hands in this transaction, so I don't see why there should be any Trading:CURRENCY splits at all.

Best regards,
        —Jim DeLaHunt, software engineer, Vancouver, Canada

On 2020-05-14 21:59, Adrien Monteleone wrote:
I’m not familiar with GC for stocks and such trades, but just looking at the 
form of the debits/credits I would hazard the guess that:

Imbalance-CAD 800.00

should be:

Trading:CURRENCY:USD 800.00

instead.

I’m basing this guess on how I see other Trading account related transactions 
balanced by GC.

The fact it used Imbalance-CAD might indeed be a bug.

Does it accept you changing the Imbalance split accordingly? (the two CURRENCY 
splits should be opposite dr/cr of each other)

Regards,
Adrien

On May 14, 2020 w20d135, at 10:16 PM, Jim DeLaHunt <[email protected]> 
wrote:

I did a curious stock transaction, and I'm having trouble when I record this 
transaction in GnuCash 3.10.

I bought some shares of a fund, DLR.U, which trades in US Dollar prices on the 
Toronto Stock Exchange. I exchanged those shares for an identical quantity of shares 
in that fund with a different name, DLR, which trades in Canadian Dollar prices on 
the Toronto Stock Exchange. The purpose was to exchange US dollars for Canadian 
dollars at lower cost, via the so-called Norbert's Gambit 
<https://wealthsavvy.ca/norberts-gambit-questrade/>.

The basic idea of Norbert's Gambit is that if the same security trades in one 
market in one currency, and also in a second market in a second currency, then 
the ratio between the two prices will always be close to the market currency 
exchange rate. If the prices ever diverge, this becomes an arbitrage 
opportunity: buy shares on the first market in the first currency, sell the 
same quantity shares on the second market for the second currency, convert 
funds back to the first currency in the conventional foreign exchange market, 
and profit. The net number of shares at the end of the transaction is zero. The 
DLR/DLR.U fund was created to facilitate Norbert's Gambit, but the same 
technique is possible with any stock which is traded in multiple liquid markets 
in multiple currencies.

I had no trouble recording my purchase of DLR.U, in US dollars, in the US Dollar-denominated brokerage 
account. I just followed the instructions in the GnuCash Guide, 9.5. 
<https://gnucash.org/viewdoc.phtml?rev=3&lang=C&doc=guide>/Buying Shares 
<https://gnucash.org/viewdoc.phtml?rev=3&lang=C&doc=guide>/.

The problem was recording the moving of the DLR.U shares to DLR, in Canadian dollars, in a 
Canadian Dollar-denominated brokerage account. I started off by following the instructions 
for a stock split in the GnuCash Guide, 9.10.2. /Moderately Complex Stock Merger/ 
<https://gnucash.org/viewdoc.phtml?rev=3&lang=C&doc=guide>. I took the example 
of SBC shares turning into ATT shares plus cash, and changed it to have DLR.U shares exchange 
for an equal number of DLR shares.

The transaction I entered was this (simplified a bit from my actual numbers):

*Account*       *Shares*        *Price*         *Buy*   *Sell*
Brokerage CAD:ETF:DLR   200     14.00   2,800.00        
Brokerage USD:ETF:DLR.U         -200    10.00   
        2,000.00

That is, move out 200 shares of the US-dollar DLR.UR, at the share price at 
which I bought them, and bring in 200 shares of the Canadian-dollar DLR, at the 
share prices they were at when I bought the DLR.U.  That's pretty much what the 
real-world journal transfer of shares in my brokerage account was like.

I expected that GnuCash would add in TRADING:FUND splits to balance the 
quantity of DLR and DLR.U shares in the transaction. I expected to see:

*Account*       *Shares*        *Price*         *Buy*   *Sell*
Brokerage CAD:ETF:DLR   200     14.00   2,800.00        
Trading:FUND:DLR.U      200
        10.00
        2,000.00
        
Brokerage USD:ETF:DLR.U         -200    10.00   
        2,000.00
Trading:FUND:DLR        -200    14.00   
        2,800.00

What I got was that, plus a Trading:CURRENCY:CAD split that was not motivated 
by anything, and then an Imbalance-CAD split to balance the 
Trading:CURRENCY:CAD split:

*Account*       *Shares*        *Price*         *Buy*   *Sell*
Brokerage CAD:ETF:DLR   200     14.00   2,800.00        
Trading:FUND:DLR.U      200     10.00   2,000.00        
Trading:CURRENCY:CAD    
        
        800.00  
Brokerage USD:ETF:DLR.U         -200    10.00   
        2,000.00
Trading:FUND:DLR        -200    14.00   
        2,800
Imbalance-CAD   
        
        
        800

I will observe that the Trading:CURRENCY:CAD split amount is exactly the 
difference between the ETF:DLR amount and the FUND:DLR.U amount, if you 
disregard that one is in CAD and the other is in USD. It makes me suspicious 
that GnuCash doesn't know how to handle a multi-currency stock swap transaction.

Should there be a way to record this transaction correctly in GnuCash? If so, 
what do I do?

Or, is this a limitation in GnuCash? If so, I should file a bug about it.

I am running GnuCash 3.10 on macOS 10.16.5. I have trading accounts enabled.

I have not found anything about Norbert's Gambit or this kind of multi-currency 
stock transaction in the documentation, the mailing list archives, the bug 
database, or the wiki.

Best regards,
       —Jim DeLaHunt, software engineer, Vancouver, Canada

_______________________________________________
gnucash-user mailing list
[email protected]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

--
    --Jim DeLaHunt, [email protected]     http://blog.jdlh.com/ (http://jdlh.com/)
      multilingual websites consultant

      355-1027 Davie St, Vancouver BC V6E 4L2, Canada
         Canada mobile +1-604-376-8953

_______________________________________________
gnucash-user mailing list
[email protected]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to