For my use case, I want to track the XIRR of an investment, which is losing funds. So imagine something like investing 100, but ending with 10. Or with a code example:
const flows = [
{
amount: 100,
date: new Date('2019-02-02'),
},
{
amount: -10,
date: new Date('2019-03-02'),
},
];
try {
console.log('XIRR:', xirr(flows), 'of', flows);
} catch (err) {
console.log(err);
}
So for this use case, the XIRR should be a negative number, because one is actually losing funds.
Is there a way to do that with this lib?