pub struct BsmSolution {
pub option_type: OptionType,
pub params: BsmParams,
pub price: f64,
pub greeks: BsmGreeks,
pub terms: BsmTerms,
pub intrinsic: f64,
pub time_value: f64,
pub forward_moneyness: f64,
pub parity_residual: f64,
/* private fields */
}Expand description
Teaching solution: price, greeks, parity check, formulas.
Prefer this for notebooks and audit logs. Prefer bsm_price / [BsmState] in production.
Fields§
§option_type: OptionType§params: BsmParams§price: f64§greeks: BsmGreeks§terms: BsmTerms§intrinsic: f64§time_value: f64§forward_moneyness: f64§parity_residual: f64C − P − (S e^{-qT} − K e^{-rT}); model-consistent prices → ≈ 0.
Implementations§
Source§impl BsmSolution
impl BsmSolution
pub fn formula(&self) -> &str
pub fn symbolic_formula(&self) -> &str
Sourcepub fn print_table(&self)
pub fn print_table(&self)
Print a one-row summary table of price + Greeks.
type price delta gamma vega theta rho
---- ------- ------ ------ ------- ------- -------
Call 10.4506 0.6368 0.0188 37.5240 -6.4140 53.2325pub fn print_table_locale(&self, locale: &Locale, precision: usize)
Trait Implementations§
Source§impl Clone for BsmSolution
impl Clone for BsmSolution
Source§fn clone(&self) -> BsmSolution
fn clone(&self) -> BsmSolution
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BsmSolution
impl RefUnwindSafe for BsmSolution
impl Send for BsmSolution
impl Sync for BsmSolution
impl Unpin for BsmSolution
impl UnsafeUnpin for BsmSolution
impl UnwindSafe for BsmSolution
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more