Open mvhulten opened 3 hours ago
@mvhulten thanks - to save confusion, could you post a minimal repro when you have time ?
PS I think it's this: an declared forward price, even an older one, is always preferred over an inferred reverse price (https://hledger.org/dev/hledger.html#finding-market-price). I think the workaround is simply to add more forward price declarations.
In my MWE it works as I want and according to the documentation.
P 2023-01-01 16:00:00 EUR 10,0 NOK
P 2024-11-18 16:00:00 EUR 11,0 NOK
2024-01-14 * conversion
EuroAccount 100,00 EUR @12,0 NOK
KronerAccount
As expected, today's value of 11,0 NOK/EUR takes precedence. In my more complex multi-file ledger such a more recent declared price is ignored.
I will look into it better and find out where it fails.
--debug 2 may be helpful.
I have this exchange rate:
but instead of using this to convert EUR from NOK, market values of transactions in the past are used when I run
hledger balance MyAccount --value=now,EUR
. I want that the above works as this:edit: I was hoping that
--show-reverse
would do that, but after realising that this is only used from theprices
command (not for e.g.balance
), I reworked this issue… which – I now realise – may be more of a support issue than a bug report (maybe it is a feature request).I am running hledger 1.33 on OpenBSD.