-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
roi "Ratio has zero denominator" when --pnl account balances to 0 #2281
Comments
Quoting from roi manual:
I think that the property "other postgres are either cash flows or PnL" does not hold for your initial transaction. Try and separate your Income postings out:
|
Thanks for the reply @adept . That does work for roi. But those first two transactions don't balance to zero individually.
|
Not sure about this. The way I read it, for that initial transaction, the Assets postings are in --inv and the Income postings are in --pnl. There are no other postings? |
I can't reproduce your unbalanced transaction with hledger from tip. But lets backtrack. Do we at least agree that both TWR and IRR for your journal would be zero? Regardless of what I think about the semantics of your journal, it is clear that division by zero should not be there, so lets at least fix that (via #2283 ) |
Yup, agreed. That's the issue I was raising here. |
Thanks for the report @iartarisi and fix @adept. We've had many of these in the tricky roi calculations unfortunately, hopefully this is the last. |
I am trying to use hledger-roi and keep track of average cost using something similar to the method described in this multicurrency accounting tutorial. That means that both the cash and stock amounts should always balance to zero. In order to do that, all buy and sell commodity transactions go through an Income:Trading account (simplified below to just Income).
This crashes roi, I think, because it can't handle the Income account evaluating to 0
The text was updated successfully, but these errors were encountered: