Open josh-m-sharpe opened 10 years ago
@crankharder why don't you give a try on my branch: https://github.com/tubedude/finance The error appears when you use 1.0 as guess (which is the standard in this release). But you should get to the correct answer by using a guess of 0.1:
trans.xirr(1).apr.to_f # => -2.212298586260735
trans.xirr(0.1).apr.to_f # => 0.1882953622624719
@tubedude confirmed that your branch fixes the issue.
My other test cases didn't change either.
I thought it was odd that the 'transactions' param wasn't being used.
See Issue #38. It's a bug in the search value function. I provided the fix (#39).
Good catch!
Good Doc's xirr() thinks the result should be: 0.1877607042
The result should certainly be positive.