beancount / beangrow

Returns calculations on portfolios in Beancount
GNU General Public License v2.0
55 stars 21 forks source link

use target currency instead of USD when computing market value #21

Closed andreasgerstmayr closed 1 year ago

andreasgerstmayr commented 1 year ago

I noticed that the market value series in the cumulative value chart doesn't match my expected values. Turns out it always got converted to USD.

This PR updates the code to convert the market value to the target currency.

erpreciso commented 1 year ago

Thanks @andreasgerstmayr , this was on my todo list for a while: I intended to replace USD with the operating currency as defined in options. Where do you define the target_currency in your version?

andreasgerstmayr commented 1 year ago

Where do you define the target_currency in your version?

The target currency is the cost currency of the investment, and is set here: https://github.com/beancount/beangrow/blob/f7a9f453543a3153d0f369add1e1766c5a641697/beangrow/reports.py#L173-L178

andreasgerstmayr commented 1 year ago

Thanks for merging! :)