Hello,

My main currency to deal with is A (where I live), but will invest on 
foreign market traded on currency C.
The gain I want to calculate is the gain against currency A rather than C 
as I finally will exchange it to A.

All numbers in the following description doesn't reflect any actual 
currency or stocks.
If I buy 5000B using 5000C on Oct 1st, and the exchange rate between A and 
C is 1:1. So my ETF asset would be value 5000A in my home currency.
And on Oct 5th, the price(in C) of B doubled. The the ETF asset value would 
be 10000A(in home currency) or 10000C(in trading currency)?
And on Oct 6th, the price of currency C in A went down to 25%, the asset 
would still value 10000C, but only 2500A in my home currency.
The investment gain against home currency(A) would be -2500A.

Ledger dat file is as follows:
2015-10-01 *
    Investment:Money Market 10000 C
    Equity:Opening Balances

2015-10-01 *
    Investment:SomeFund 5000 B
    Investment:Money Market -5000 C


pricedb:
P 2015-01-01 C A 1
P 2015-10-05 B C 2
P 2015-10-06 C A 0.25



The reg works good with -X A or -X C:
$ ledger -f out.ledger reg Some --price-db pricedb  -X A   
15-Oct-01 <Unspecified payee>                             
Investment:SomeFund                                                         
   A5000                        A5000
15-Oct-06 Commodities revalued                            <Revalued>       
                                                             A-2500         
               A2500

$ ledger -f out.ledger reg Some --price-db pricedb  -X C   
15-Oct-01 <Unspecified payee>                             
Investment:SomeFund                                                         
  5000 C                       5000 C
15-Oct-05 Commodities revalued                            <Revalued>       
                                                             5000 C         
             10000 C

but adding -G to calculate gain:
$ ledger -f out.ledger reg Some --price-db pricedb  -X C -G   # in curreny 
C, working good
15-Oct-05 Commodities revalued                            <Revalued>       
                                                             5000 C         
              5000 C

$ ledger -f out.ledger reg Some --price-db pricedb  -X A -G # but in 
curreny A, 0ops
15-Oct-01 <Unspecified payee>                             
Investment:SomeFund                  A5000
                                                                            
                                                           -5000 C         
               A5000
                                                                            
                                                                            
                  -5000 C
15-Oct-05 Commodities revalued                            <Revalued>       
                            A5000                       A10000
                                                                            
                                                                            
              -5000 C
15-Oct-06 Commodities revalued                            <Revalued>       
                           A-7500                        A2500
                                                                            
                                                                            
                -5000 C
# Adding another -X A to convert -5000C to A doesn't help as -5000C is 
calculated in current rate.
ledger -f out.ledger reg Some --price-db pricedb  -X A -G -X A
15-Oct-06 Commodities revalued                            <Revalued>       
                                                             A-2500         
               A1250


Is there a way to get the gain(total values in A  now - totoal value in A 
before) in currency A, which is -2500A?

Thanks

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to