pub struct WorstOfAutocallable {
pub symbol: String,
pub spots: Vec<f64>,
pub vols: Vec<f64>,
pub dividends: Vec<f64>,
pub correlations: Vec<Vec<f64>>,
pub payoff: AutocallablePayoff,
pub maturity_date: NaiveDate,
pub valuation_date: NaiveDate,
pub discount_curve: YieldCurve,
pub mc: MonteCarloConfig,
/* private fields */
}Expand description
Autocallable note on the worst-of performance of a correlated basket.
Fields§
§symbol: String§spots: Vec<f64>Current spots — also the contractual initial fixings that normalize the worst-of performance (the note is assumed priced from inception levels; Greek bumps move the market spot, never the fixing).
vols: Vec<f64>§dividends: Vec<f64>§correlations: Vec<Vec<f64>>§payoff: AutocallablePayoffRedemption logic; its barriers are worst-of performance levels in
initial_fixing units (e.g. fixing 100, autocall 100 = 100% of
initial, protection 70 = 70% of initial).
maturity_date: NaiveDate§valuation_date: NaiveDate§discount_curve: YieldCurve§mc: MonteCarloConfigImplementations§
Source§impl WorstOfAutocallable
impl WorstOfAutocallable
Sourcepub fn new(
symbol: &str,
spots: Vec<f64>,
vols: Vec<f64>,
dividends: Vec<f64>,
correlations: Vec<Vec<f64>>,
payoff: AutocallablePayoff,
maturity_date: NaiveDate,
valuation_date: NaiveDate,
discount_curve: YieldCurve,
mc: MonteCarloConfig,
) -> Result<Self, RustyQLibError>
pub fn new( symbol: &str, spots: Vec<f64>, vols: Vec<f64>, dividends: Vec<f64>, correlations: Vec<Vec<f64>>, payoff: AutocallablePayoff, maturity_date: NaiveDate, valuation_date: NaiveDate, discount_curve: YieldCurve, mc: MonteCarloConfig, ) -> Result<Self, RustyQLibError>
Validate and construct: dimensions must agree, and a correlation matrix that fails PSD is repaired with Higham’s projection (an asymmetric or non-unit-diagonal matrix is a data error and still rejected).
pub fn time_to_maturity(&self) -> f64
pub fn npv_with_stats(&self) -> McStats
pub fn theta(&self) -> f64
pub fn rho(&self) -> f64
Trait Implementations§
Source§impl Instrument for WorstOfAutocallable
impl Instrument for WorstOfAutocallable
Source§fn try_npv(&self) -> Result<f64, RustyQLibError>
fn try_npv(&self) -> Result<f64, RustyQLibError>
Present value, or a typed error when the instrument cannot be priced
(invalid inputs, or an engine/product combination the library
refuses to price).
Source§fn price(&self) -> Result<PricingResult, RustyQLibError>
fn price(&self) -> Result<PricingResult, RustyQLibError>
Price the instrument once, returning value, Greeks and (for Monte
Carlo engines) the standard error together in a
PricingResult. Read moreSource§fn npv(&self) -> f64
fn npv(&self) -> f64
Present value, panicking on any pricing error. Convenience for
instruments already known to be valid; fallible callers (batch
pricing, services) should use
Instrument::try_npv.Auto Trait Implementations§
impl Freeze for WorstOfAutocallable
impl RefUnwindSafe for WorstOfAutocallable
impl Send for WorstOfAutocallable
impl Sync for WorstOfAutocallable
impl Unpin for WorstOfAutocallable
impl UnsafeUnpin for WorstOfAutocallable
impl UnwindSafe for WorstOfAutocallable
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