pub struct ImpliedVolatilitySurface { /* private fields */ }Expand description
Implied volatility surface
Implementations§
Source§impl ImpliedVolatilitySurface
impl ImpliedVolatilitySurface
Sourcepub fn new(spot: f64, rate: f64, dividend: f64) -> Self
pub fn new(spot: f64, rate: f64, dividend: f64) -> Self
Create a new implied volatility surface
Sourcepub fn add_quote(
&mut self,
strike: f64,
maturity: f64,
implied_vol: f64,
bid_ask_spread: Option<f64>,
)
pub fn add_quote( &mut self, strike: f64, maturity: f64, implied_vol: f64, bid_ask_spread: Option<f64>, )
Add an implied volatility quote
Sourcepub fn get_vol(&self, strike: f64, maturity: f64) -> Option<f64>
pub fn get_vol(&self, strike: f64, maturity: f64) -> Option<f64>
Get implied volatility for a given strike and maturity
Sourcepub fn maturities(&self) -> Vec<f64>
pub fn maturities(&self) -> Vec<f64>
Get all maturities
Sourcepub fn to_option_quotes(&self) -> Result<Vec<OptionQuote>>
pub fn to_option_quotes(&self) -> Result<Vec<OptionQuote>>
Convert to option quotes (for calibration)
Auto Trait Implementations§
impl Freeze for ImpliedVolatilitySurface
impl RefUnwindSafe for ImpliedVolatilitySurface
impl Send for ImpliedVolatilitySurface
impl Sync for ImpliedVolatilitySurface
impl Unpin for ImpliedVolatilitySurface
impl UnwindSafe for ImpliedVolatilitySurface
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> 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