-
-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--infer-market-prices is not limited by queries #2092
Comments
Hi! I think the current behavior is correct, and in my use case it is more useful. I don't track stocks but have expenses and accounts in multiple currencies. And before I started using I see you point that it can be surprising, depending on your mental model, an inconvenient with the book closing transaction. I wouldn't call it a bug, but rather matter of ensuring the documentation is clear and perhaps creating a separate feature for "filtered" inferred prices |
Thanks for the report and response. I tend to agree with @wgslr. I'll try to justify it as well: market prices are a kind of immutable background data, with a fixed value on each date. We normally read them from explicit P directives; or we can automate that more by generating the P directives from transactions with --infer-market-prices. Other than choosing valuation date, we don't get to/want to choose subsets of market prices. (If you did need that, you could arrange to put them in different price files and select the one you want at report time.) |
Perhaps saying something about this at https://hledger.org/dev/hledger.html#--infer-market-prices-market-prices-from-transactions would be helpful ? A draft or PR is welcome |
I agree that perhaps it is not a bug, only a handicap of using But I found so disturbing the closing books case. Because the closing book documentation proposes to use the The solution for closing books and using the I would add some comment to https://hledger.org/dev/hledger.html#example-excluding-closingopening-transactions or I would close this issue. If anybody else faces again this issue, it can find the solution in this closed issue. |
Thanks for the suggestion. I haven't really understood exactly where the problem arises with close. What comment would you suggest ?
Yes, that is (should be) our general recommendation when inferred market prices aren't working out ("...value reports can sometimes be affected in confusing/undesired ways by your journal entries...") - declare market prices explicitly with P. |
I am not sure if this is a bug or if it is something to live with. I only open the issue for your consideration.
Description: when
--infer-market-prices
is used all the transactions and postings are considered for pricing purpose, even if those are excluded in the current search.Example:
Journal file:
When the value is calculated without
--infer-market-prices
, I get the good value:When the value is inferred I get bad value:
Even If I exclude the
clopen
entries:This behavior can be a bit confusing, specially when we close books. In the close books documentation it is proposed to use the
clopen
tag to exclude the open/close transactions when we want an inter-annual report. Well, if we use--infer-market-prices
, the inferred price ofclopen
transactions is not excluded. This could be solved by different ways:--infer-market-prices
behavior--infer-market-prices
in the reports it is recommend to provide "P" directives to the open/close dates to avoid issues with the valuation of assets in inter-annual reports.Version:
The text was updated successfully, but these errors were encountered: