pub struct BermudanOption {
pub instrument: Instrument,
pub strike: f64,
pub time_to_maturity: f64,
pub expiration_dates: Vec<f64>,
pub option_type: OptionType,
}Expand description
A struct representing an Bermudan option.
Fields§
§instrument: InstrumentThe underlying instrument.
strike: f64Strike price of the option (aka exercise price).
time_to_maturity: f64The time horizon (in years).
expiration_dates: Vec<f64>The expiration dates of the option (in years).
option_type: OptionTypeType of the option (Call or Put).
Implementations§
Source§impl BermudanOption
impl BermudanOption
Sourcepub fn new(
instrument: Instrument,
strike: f64,
expiration_dates: Vec<f64>,
option_type: OptionType,
) -> Self
pub fn new( instrument: Instrument, strike: f64, expiration_dates: Vec<f64>, option_type: OptionType, ) -> Self
Create a new BermudanOption.
Trait Implementations§
Source§impl Clone for BermudanOption
impl Clone for BermudanOption
Source§fn clone(&self) -> BermudanOption
fn clone(&self) -> BermudanOption
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BermudanOption
impl Debug for BermudanOption
Source§impl Option for BermudanOption
impl Option for BermudanOption
Source§fn instrument(&self) -> &Instrument
fn instrument(&self) -> &Instrument
Get the underlying instrument of the option. Read more
Source§fn instrument_mut(&mut self) -> &mut Instrument
fn instrument_mut(&mut self) -> &mut Instrument
Get the underlying instrument of the option (mutable). Read more
Source§fn set_instrument(&mut self, instrument: Instrument)
fn set_instrument(&mut self, instrument: Instrument)
Set the underlying instrument of the option. Read more
Source§fn time_to_maturity(&self) -> f64
fn time_to_maturity(&self) -> f64
Time horizon (in years). Read more
Source§fn expiration_dates(&self) -> Option<&Vec<f64>>
fn expiration_dates(&self) -> Option<&Vec<f64>>
Get the expiration dates of the option. Read more
Source§fn set_time_to_maturity(&mut self, time_to_maturity: f64)
fn set_time_to_maturity(&mut self, time_to_maturity: f64)
Set the time horizon (in years). Read more
Source§fn option_type(&self) -> OptionType
fn option_type(&self) -> OptionType
Get the type of the option. Read more
Source§fn style(&self) -> &OptionStyle
fn style(&self) -> &OptionStyle
Get the style of the option. Read more
Source§fn payoff(&self, spot: Option<f64>) -> f64
fn payoff(&self, spot: Option<f64>) -> f64
Calculate the payoff of the option at maturity. Read more
Source§fn price<T: OptionPricing>(&self, model: T) -> f64
fn price<T: OptionPricing>(&self, model: T) -> f64
Calculate the price of the option. Read more
Source§fn time_value<T: OptionPricing>(&self, model: T) -> f64
fn time_value<T: OptionPricing>(&self, model: T) -> f64
Calculate the time value of the option. Read more
Auto Trait Implementations§
impl Freeze for BermudanOption
impl RefUnwindSafe for BermudanOption
impl Send for BermudanOption
impl Sync for BermudanOption
impl Unpin for BermudanOption
impl UnsafeUnpin for BermudanOption
impl UnwindSafe for BermudanOption
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.