Ok,

I now see, that the unrealized gains plugin 
<https://github.com/beancount/beancount/blob/v2/beancount/plugins/unrealized.py>
 
comes close to what I am looking for, except that it only looks at the 
plosions, which have cost.

So, I would have to create something, based on this plugin

By the way, what is the exact reason the unrealized gains plugin ignores 
changes for the positions, where there is no initial cost information?  
Correct me if am  wrong, but the reason beancount has a feature to track 
cost is to accommodate requirements of tax law in certain countries. But 
for sure one would want to know why his net worth has changed in the period 
from date A to date B regardless of whether he reordered the cost 
information. 

On Sunday, February 26, 2023 at 8:07:54 PM UTC+1 Chary Chary wrote:

> Dear all, 
>
> I al looking for some report / beanquery which would explain change 
> between the net worth report, taken at 2 moments in time and will taken 
> into account changes in price.
>
> Explanation:
>
> suppose I have the file
>
> ==================================================================
>
> option "operating_currency" "EUR"
>
> 2000-01-01 commodity EUR
>   name: "Euro"
>   asset-class: "cash"
>
> 2000-01-01 commodity USD
>   name: "US dollar"
>   asset-class: "cash"
>
> 2000-01-01 commodity CAR
>
>
> 2000-01-01 open Assets:Captinal:Car
> 2000-01-01 open Assets:Bank-EU
> 2000-01-01 open Assets:Bank-US
>
> 2000-01-01 open Equity:Opening-Balances
>
> 2000-01-01 * "Opening Balances"
>     Assets:Bank-EU   10000.00 EUR
>     Equity:Opening-Balances -10000.00 EUR
>
> 2000-01-01 * "Opening Balances"
>     Assets:Bank-US   10000.00 USD
>     Equity:Opening-Balances -10000.00 USD
>
> 2000-01-02 * "Buying Car"
>     Assets:Captinal:Car  1 CAR @@ 5000.00 EUR
>     Assets:Bank-EU -5000.00 EUR 
>
> ; Depretiation of the car enetered as a change in price
> 2000-01-02 price CAR 5000.00 EUR
>
> 2000-02-01 price CAR 4500.00 EUR
>
> ; Changes in EUR/USD exchange rate
> 2000-01-01 price USD 1 EUR
>
> 2000-04-01 price USD 0.5 EUR 
>
> ====================================================================
>
> My net worth in EURO at the beginning of the Y2000 is:
>
> beanquery> select account, SUM(convert(cost(position),"EUR", 2000-01-01)) 
> as value where date <= 2000-01-01 and (account ~"Assets" or account ~ 
> "Liabilities")
>    account        value
> -------------- ------------
> Assets:Bank-EU 10000.00 EUR
> Assets:Bank-US 10000.00 EUR
>
> *Total 20 000 EUR*
>
>
> My net worth in EURO end of the 2000 is:
>
> beanquery> select account, SUM(convert(cost(position),"EUR", 2000-12-31)) 
> as value where date <= 2000-12-31 and (account ~"Assets" or account ~ 
> "Liabilities")
>       account          value
> ------------------- -----------
> Assets:Bank-EU      5000.00 EUR
> Assets:Bank-US      5000.00 EUR
> Assets:Captinal:Car 4500.00 EUR
>
> *Total 14 500 EUR*
>
> Difference is *5500 EUR*
>
> So, I am looking for a report, which would explain this difference in the 
> following way:
>
> price_changes USD/EUR  -5000 EUR
> price_changes CAR/EUR    -500 EUR
> -------------------------------------------------------------
> Total                                     *-5500 EUR*
>
> Is there something like this? May be with unrealized gains?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/cffb12a3-97e8-47bd-a03c-307bcb536318n%40googlegroups.com.

Reply via email to