pub struct OptionSpec {
pub kind: OptionKind,
pub spot: Decimal,
pub strike: Decimal,
pub time_to_expiry: Decimal,
pub risk_free_rate: Decimal,
pub volatility: Decimal,
}Expand description
All inputs required to price a European option under Black-Scholes.
Fields§
§kind: OptionKindOption type: call or put.
spot: DecimalCurrent underlying price (S). Must be positive.
strike: DecimalStrike price (K). Must be positive.
time_to_expiry: DecimalTime to expiry in years (T). Must be positive.
risk_free_rate: DecimalAnnualised risk-free rate (r). May be negative.
volatility: DecimalAnnualised implied/historical volatility (σ). Must be positive.
Trait Implementations§
Source§impl Clone for OptionSpec
impl Clone for OptionSpec
impl Copy for OptionSpec
Source§impl Debug for OptionSpec
impl Debug for OptionSpec
Source§impl<'de> Deserialize<'de> for OptionSpec
impl<'de> Deserialize<'de> for OptionSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OptionSpec
impl RefUnwindSafe for OptionSpec
impl Send for OptionSpec
impl Sync for OptionSpec
impl Unpin for OptionSpec
impl UnsafeUnpin for OptionSpec
impl UnwindSafe for OptionSpec
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