Skip to content

Mechanism for calculating negative resulting XIRR values #2

@superKalo

Description

@superKalo

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions