java-xirr icon indicating copy to clipboard operation
java-xirr copied to clipboard

Java implementation of xirr with bonus Newton-Raphson implementation

Results 10 java-xirr issues
Sort by recently updated
recently updated
newest added

Has anyone compared this implementation to the one in Excel? Apache POI lacks an implementation of XIRR and it's possible that this code might be a good starting point for...

Hi @RayDeCampo, thank you for bringing this lib to the world. Are you planning to tackle the leap year problem?

My code test that is with error and version xirr is latest(1.2): ` @Test public void xirrTestXirrTestTest(){ Double rate = new Xirr(getMockTransactionsXirr()).xirr(); System.out.println(rate); } private List getMockTransactionsXirr() { List listTransaction...

Could not calculate negative Xirr, as below values `new Xirr(new Transaction(-10000d, "2022-01-24"), new Transaction(9800d, "2022-01-28")).xirr();` gives below error ``` Exception in thread "main" org.decampo.xirr.OverflowException: Candidate overflow: {guess=-1.825, iteration=159, candidate=-Infinity, value=-2.3355275185815405E7,...

List list = Arrays.asList( new Transaction(-275112000,"2015-07-15"), new Transaction(-57258697.67,"2017-05-02"), new Transaction( 2577101.75,"2017-11-10"), new Transaction(-2184516955.15,"2018-10-10"), new Transaction(-660239840,"2019-01-29"), new Transaction(-26567773295.82,"2021-05-13") ); com.littlefox.xirr.NonconvergenceException: Newton-Raphson failed to converge within 1000000000 iterations.

At the moment only actual over 365 is supported, but many contracts specify actual over 360. It should be possible to override the default value, and specify a custom number...

Added the ability to set the days in year for both the constructor and builder approaches. Default is 365 so that there is no regression impact Test cases added to...

2019/8/29 -500000000 2019/10/20 6882638.89 2020/1/20 11947222.22 2020/4/20 11817361.11 2020/7/20 11817361.11 2020/8/29 50000000 2020/8/29 506458.33 2020/10/20 10752500 2021/1/20 10752500 2021/2/28 50000000 2021/2/28 506458.33 2021/4/20 9350000 2021/7/20 9453888.89 2021/8/30 532430.56 2021/8/30 50000000...

The test case is: ``` 4/2/2023 -7.0049467 4/3/2023 -0.0000041 4/3/2023 6.94963 ``` In google sheet, XIRR returns `-0.9446451026`, but this library returns `org.decampo.xirr.OverflowException: Candidate overflow`.