Struct EquityOption
pub struct EquityOption {
pub name: String,
pub currency: Currency,
pub kind: OptionKind,
pub strike: f64,
pub expiry: NaiveDate,
pub quantity: f64,
pub collateral: CollateralSpec,
pub barrier: Option<Barrier>,
}Expand description
A European option on quantity shares of one equity, exercised and
settled in cash on its expiry, with an optional single barrier.
Fields§
§name: StringThe equity’s name, as the market quotes its spot and vol surface.
currency: CurrencyThe premium and settlement currency.
kind: OptionKindCall or put.
strike: f64The strike per share.
expiry: NaiveDateThe exercise and payment date.
quantity: f64Shares; negative is short.
collateral: CollateralSpecThe discounting collateral.
barrier: Option<Barrier>A single knock-in or knock-out barrier; None is a vanilla.
Implementations§
§impl EquityOption
impl EquityOption
pub fn new(
name: impl Into<String>,
currency: Currency,
kind: OptionKind,
strike: f64,
expiry: NaiveDate,
quantity: f64,
) -> Result<Self, EquityOptionError>
pub fn new( name: impl Into<String>, currency: Currency, kind: OptionKind, strike: f64, expiry: NaiveDate, quantity: f64, ) -> Result<Self, EquityOptionError>
A long or short option on quantity shares of name, discounted on
the currency’s cash collateral.
§Errors
EquityOptionError for a non-positive strike or a zero quantity.
pub fn with_barrier(
self,
kind: BarrierKind,
level: f64,
rebate: f64,
) -> Result<Self, EquityOptionError>
pub fn with_barrier( self, kind: BarrierKind, level: f64, rebate: f64, ) -> Result<Self, EquityOptionError>
This option with a single continuously monitored barrier.
§Errors
EquityOptionError::MalformedBarrier for a non-positive level or a
negative rebate.
Trait Implementations§
§impl Clone for EquityOption
impl Clone for EquityOption
§fn clone(&self) -> EquityOption
fn clone(&self) -> EquityOption
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for EquityOption
impl Debug for EquityOption
§impl PartialEq for EquityOption
impl PartialEq for EquityOption
§impl<R: Scalar> Priceable<R> for EquityOption
impl<R: Scalar> Priceable<R> for EquityOption
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
Black-Scholes on the dividend-free forward F = S / P(T):
Q · P(T) · Black76(F, K, σ(T, K), τ), or the closed-form single-barrier
value with a barrier; zero on and after expiry.
§fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
§fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
§impl PricingRiskFactors for EquityOption
impl PricingRiskFactors for EquityOption
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
The collateral’s discount curve, the equity’s spot and its vol surface.
§impl Product for EquityOption
impl Product for EquityOption
§fn currency(&self) -> Currency
fn currency(&self) -> Currency
§fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>
fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>
(name, date) pairs —
exactly the dates its stated constructor takes, so a product built
through a derived form can be read back and rebuilt through the stated
one. Empty for a product with no stated form. No default: every
product states which it is — see AnyInstrument::contract_dates.§fn legs(&self) -> Option<Vec<&Leg>>
fn legs(&self) -> Option<Vec<&Leg>>
None
for a product that holds none — see AnyInstrument::legs. No
default: every product states which it is.§fn final_payment_date(&self) -> Option<NaiveDate>
fn final_payment_date(&self) -> Option<NaiveDate>
None for a product no ladder is built from.§fn restruck_at_rate(&self, _rate: f64) -> Option<AnyInstrument>
fn restruck_at_rate(&self, _rate: f64) -> Option<AnyInstrument>
rate — the scalar a par
calibration rung on it is quoted in — or None for a product that
carries no such scalar. What a quote scenario moves a rung to.§fn restruck_at_spread(&self, _spread: f64) -> Option<AnyInstrument>
fn restruck_at_spread(&self, _spread: f64) -> Option<AnyInstrument>
spread on its spread
leg, or None for a product that quotes none.