Xirr
TODO: add coveralls here...
A library to calculate XIRR.
Usage
iex> d = [{1985, 1, 1}, {1990, 1, 1}, {1995, 1, 1}]
iex> v = [1000, -600, -200]
iex> Xirr.xirr(d,v)
{:ok, -0.034592}
Installation
The package can be installed as:
Add xirr to your list of dependencies in
mix.exs
:def deps do [{:xirr, "~> 1.0.0"}] end
Ensure xirr is started before your application:
def application do [applications: [: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
- The reports are available locally.
Credits
The initial work on this project was done by Scripbox India Pvt Ltd, https://scripbox.com as part of ex_xirr
.
This application is built on the fantastic finance-elixir package. Many thanks to tubedude for his work.