Comments (2)
Hi @jadfls
Nice find on the guess value part that you mentioned, but yeah it does pose the difficulty of correctly assuming an initial close value.
I have kept the usage of this package limited to any fallback calls(if others fail), and have shifted my primary package to
webcarrot/xirr, which is based on the XIRR function call from the LibreOffice Software
Since it is closely associated with the MS Office Excel etc., softwares, it correctly calculates values for 99.9% of the use cases, for others, there's usually a problem with improper set of transactions, else, I use fallback calls to this and other XIRR packages to get a value. But mostly those are very corner cases
from finance.js.
I can confirm this issue. Sample code:
const Finance = require('financejs');
var finance = new Finance();
var start = new Date(Date.parse("2013-12-31"));
var end = new Date(Date.parse("2014-05-15"));
var irr = finance.XIRR([-37987348, 21191041], [start, end], 0);
console.log(irr); //will not calculate
However, if you (somehow) correctly guess the initial guess close to the result, it will work.
var irr = finance.XIRR([-37987348, 21191041], [start, end], -0.8);
console.log(irr); //-79.36
@harzkr did you find a solution to your problem?
from finance.js.
Related Issues (20)
- Wrong value in FV example within the documentation HOT 1
- Issue new release HOT 2
- financejs.org has expired; move wiki to github HOT 1
- seekZero IRR bug HOT 3
- Not an issue HOT 1
- new calcs HOT 1
- NPV not working HOT 1
- Time-weighted Rate of Return? HOT 1
- Is there a need for a real object in this library? HOT 1
- Website is outdated HOT 2
- PV not working the same as Excel
- [IRR-Question] Excel can generate result and finance.js can't HOT 6
- [XIRR] The return of the follow instruction is not a % is an amount HOT 2
- Typescript definition update
- finance.IRR causes "Cannot convert undefined or null to object" error HOT 2
- Incorrect formula for FV calculation
- XIRR function not available in TypeScript
- IRR precision HOT 1
- New maintainer of this project HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from finance.js.