Linux | Codecov |
---|---|
black_scholes_rust
This is a simple Black Scholes option calculator written in rust. Documentation is on docs.rs.
using black_scholes_rust
Put the following in your Cargo.toml:
[]
= "0.3"
Import and use:
extern crate black_scholes;
let stock = 5.0;
let strike = 4.5;
let discount = 0.99;
let sigma = 0.3;
let maturity:f64 = 2.0;
let sqrt_maturity_sigma = sigma*maturity.sqrt;
let price = call_discount;
tests
Note that the greeks don't have direct tests. Please feel free to add tests. However, these formulas are essentially and extensively tested in the fang oost option library.