Open sertxudev opened 5 days ago
The problem seems to be caused by the calculation logic in the HoldingsService
. It's using the holding currency instead of the asset currency to get the exchange rate.
Additionally, there's book_value_converted
field that doesn't make much sense to me, since it's not calculated using the exchange rate from day of the activity but the current exchange rate
It gets even more interesting when you have 3 currencies in the setup.
A
as a base currencyB
and C
currenciesBUY
activity of any asset to both accounts and compare the numbers on the account and holdings pagesI think the discrepancies come from the confusion around book_value
For examample if we have an account in currency B
but the asset currency is C
, then the value of market_value
is in currency C but book_value
is in currency B
. What's even more confusing both of values are converted using the same exchange rate to the base account currency A
this code does that
Hi, awesome work!
I've noticed account holdings are shown with the account currency (EUR):
These should be:
The values shown are retrieved from Yahoo finance, which are stored in USD.
The account holdings should be converted to EUR (or whatever the account currency is).
The other values in the account are working as expected.
So the bug it's only at the account holdings table.