16 releases (6 breaking)
0.24.2 | Jul 28, 2023 |
---|---|
0.24.0 | Apr 2, 2023 |
0.23.1 | Mar 12, 2023 |
#223 in Finance
54 downloads per month
1MB
1.5K
SLoC
Contains (ELF lib, 45KB) lib/lets_be_rational.so
black76
This library provides an simple, lightweight, and efficient (though not heavily optimized) implementation of the Black76 model for pricing European options.
Includes all first, second, and third order Greeks.
Implements both:
- calc_iv() in the ImpliedVolatility trait which uses Modified Corrado-Miller by Piotr P√luciennik (2007) for the initial volatility guess and the Newton Raphson algorithm to solve for the implied volatility.
- calc_rational_iv() in the ImpliedVolatility trait which uses "Let's be rational" method from "Let’s be rational" (2016) by Peter Jackel. Utilizing Jackel's C++ implementation to get convergence within 2 iterations with 64-bit floating point accuracy.
Usage
View the docs for usage and examples.
Dependencies
~6.5MB
~128K SLoC