#![allow(unused_imports)] #![allow(warnings)] #![allow(dead_code)] #![allow(unused_variables)] #![allow(unused_must_use)] #![allow(non_snake_case)] #[allow(non_camel_case_types)] use rspp::option_price::baw; use rspp::option_price::binomial_tree; use rspp::option_price::bsm::Option; // #[test] fn test_bsm() { let op = Option { is_call: true, S: 217.36, // base asset price K: 220.0, // exacuate price T: 13.0 / 365.0, divdend: 0.44 / 100.0, //divdent rate r: 4.62 / 100.0, //risk free rate }; let vol = 35.23 / 100.0; let mp = 4.6; let price = op.bsm_price(vol); let theta = op.bsm_theta(vol); let vega = op.bsm_vega(vol); let rho = op.bsm_rho(vol); let gamma = op.bsm_gamma(vol); let delta = op.bsm_delta(vol); let imply = op.bsm_implied_vol(mp); dbg!("bsm==", imply, price, delta, gamma, theta, vega, rho); }