Crate blackscholes_pythonsource ·
This library provides an simple, lightweight, and efficient (though not heavily optimized) implementation of the Black-Scholes-Merton model for pricing European options.
Simply create an instance of the
Inputs struct and call the desired method.
let inputs: blackscholes::Inputs = blackscholes::Inputs.new(blackscholes::OptionType::Call, 100.0, 100.0, None, 0.05, 0.02, 20.0 / 365.25, Some(0.2)); let price: f64 = inputs.calc_price();
See the Github Repo for full source code. Other implementations such as a npm WASM package and a pure Rust Crate are also available.
The inputs to the Black-Scholes-Merton model.
The type of option to be priced. Call or Put.