A library to calculate xirr using the Newton Raphson method.
iex> d = [{1985, 1, 1}, {1990, 1, 1}, {1995, 1, 1}]
iex> v = [1000, -600, -200]
iex> ExXirr.xirr(d,v)
{:ok, -0.034592}
The package can be installed as:
-
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
-
Ensure ex_xirr is started before your application:
def application do [ extra_applications: [:logger, :ex_xirr] ] end
- Run the test suite using the following
MIX_ENV=test mix test
- We use benchee for the benchmark tests. Run it using the following
mix run test/xirr_comparison_bench.exs
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.