Skip to main content

FlatSmileSection

Struct FlatSmileSection 

Source
pub struct FlatSmileSection { /* private fields */ }
Expand description

A SmileSection with one volatility for every strike.

Implementations§

Source§

impl FlatSmileSection

Source

pub fn with_reference_date( exercise_date: Date, vol: Volatility, day_counter: DayCounter, reference_date: Date, atm_level: Option<Rate>, volatility_type: VolatilityType, shift: Rate, ) -> QlResult<FlatSmileSection>

Flat section anchored to a fixed reference date (C++’s Date constructor).

§Errors

Propagates SmileSectionBase::with_reference_date.

Source

pub fn with_exercise_time( exercise_time: Time, vol: Volatility, day_counter: DayCounter, atm_level: Option<Rate>, volatility_type: VolatilityType, shift: Rate, ) -> QlResult<FlatSmileSection>

Flat section built from an exercise time (C++’s Time constructor).

§Errors

Propagates SmileSectionBase::with_exercise_time.

Trait Implementations§

Source§

impl Clone for FlatSmileSection

Source§

fn clone(&self) -> FlatSmileSection

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FlatSmileSection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl SmileSection for FlatSmileSection

Source§

fn base(&self) -> &SmileSectionBase

The shared state holder.
Source§

fn volatility_impl(&self, _strike: Rate) -> QlResult<Volatility>

Volatility at strike; the caller owns any range checking. Read more
Source§

fn min_strike(&self) -> Rate

The lowest strike the section can quote.
Source§

fn max_strike(&self) -> Rate

The highest strike the section can quote.
Source§

fn atm_level(&self) -> Option<Rate>

The at-the-money level, or None when the section provides none.
Source§

fn volatility(&self, strike: Rate) -> QlResult<Volatility>

Volatility at strike. Read more
Source§

fn variance(&self, strike: Rate) -> QlResult<Real>

Black variance at strike: volatility^2 * exercise_time (C++’s varianceImpl). Read more
Source§

fn exercise_time(&self) -> Time

The exercise time this section was built for.
Source§

fn day_counter(&self) -> DayCounter

The day counter used to turn dates into times.
Source§

fn volatility_type(&self) -> VolatilityType

The volatility model this section is quoted against.
Source§

fn shift(&self) -> Rate

The lognormal shift applied to strike and forward.
Source§

fn reference_date(&self) -> QlResult<Date>

The reference date the section is anchored to. Read more
Source§

fn option_price( &self, strike: Rate, option_type: OptionType, discount: Real, ) -> QlResult<Real>

Undiscounted-times-discount price of a European option struck at strike, priced through the section’s volatility model. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.