Skip to content

An Elixir package for calculating XIRR.

License

Notifications You must be signed in to change notification settings

copia-wealth-studios/ex-xirr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExXirr

A library to calculate xirr using the Newton Raphson method.

Usage

iex> d = [{1985, 1, 1}, {1990, 1, 1}, {1995, 1, 1}]
iex> v = [1000, -600, -200]
iex> ExXirr.xirr(d,v)
{:ok, -0.034592}

Installation

The package can be installed as:

  1. Add ex_xirr to your list of dependencies in mix.exs:

    def deps do
      [
        {:ex_xirr, "~> 1.0.0", github: "copia-wealth-studios/ex-xirr"},
      ]
    end
  2. Ensure ex_xirr is started before your application:

    def application do
      [
        extra_applications: [:logger, :ex_xirr]
      ]
    end

Test

  • Run the test suite using the following
    MIX_ENV=test mix test
    

Benchmarks

  • We use benchee for the benchmark tests. Run it using the following
    mix run test/xirr_comparison_bench.exs
    

Credits

This is a fork of scripbox/ex-xirr.

This application is built on the fantastic finance-elixir package. Many thanks to tubedude for his work.

About

An Elixir package for calculating XIRR.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages