pub struct AccumulatorPayoff {
pub exercise_style: ContractStyle,
pub side: AccumulatorSide,
pub barrier: f64,
pub observations: usize,
pub shares_per_day: f64,
pub gearing: f64,
}Expand description
The accumulator as a mainline [Payoff], pricing inside
EquityOption on the
shared Monte Carlo engine (GBM, local vol and Heston via QE-M) — which
gives it the market context for free: snapshot_market/npv_in
rebinding, portfolio membership and the stress runner. The strike is
the contract’s strike_price; spot, curve and surface come from the
bound market. The standalone Accumulator remains the closed-form
(continuously monitored) validation reference.
Cash flows land on their own observation dates, so like
AutocallablePayoff
it is valued per path through path_value with
per-date discount factors, not through path_payoff.
Fields§
§exercise_style: ContractStyle§side: AccumulatorSide§barrier: f64Knock-out level (above spot for accumulators, below for decumulators; enforced at build).
observations: usizeEqually spaced observation days over the life (last = maturity).
gearing: f64Quantity multiplier on the adverse side (2 = classic double-up).
Implementations§
Source§impl AccumulatorPayoff
impl AccumulatorPayoff
Sourcepub fn path_value(
&self,
path: &[f64],
obs_idx: &[usize],
dfs: &[f64],
strike: f64,
) -> f64
pub fn path_value( &self, path: &[f64], obs_idx: &[usize], dfs: &[f64], strike: f64, ) -> f64
Value of one simulated path: daily accrual q [ (S_i - K)+ - gearing (K - S_i)+ ] (mirrored for decumulators), each day
discounted on its own date, stopping — without accruing — on the
first observation at or through the knock-out. obs_idx maps
observation m to its path step; dfs[m] discounts its date.
Trait Implementations§
Source§impl Clone for AccumulatorPayoff
impl Clone for AccumulatorPayoff
Source§fn clone(&self) -> AccumulatorPayoff
fn clone(&self) -> AccumulatorPayoff
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AccumulatorPayoff
impl Debug for AccumulatorPayoff
Source§impl Payoff for AccumulatorPayoff
impl Payoff for AccumulatorPayoff
Source§fn payoff(&self, _spot: f64, _strike: f64) -> f64
fn payoff(&self, _spot: f64, _strike: f64) -> f64
Degenerate single-point value: zero (all value is schedule- and path-dependent).
Source§fn path_payoff(&self, _path: &[f64], _strike: f64) -> f64
fn path_payoff(&self, _path: &[f64], _strike: f64) -> f64
Source§fn is_path_dependent(&self) -> bool
fn is_path_dependent(&self) -> bool
fn payoff_kind(&self) -> PayoffType
fn put_or_call(&self) -> &PutOrCall
fn exercise_style(&self) -> &ContractStyle
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Source§fn clone_box(&self) -> Box<dyn Payoff>
fn clone_box(&self) -> Box<dyn Payoff>
Box<dyn Payoff> are cloneable (repricing a contract under another
market clones the instrument). Implementors write
Box::new(self.clone()).Source§fn payoff_amount(&self, spot: f64, strike: f64) -> f64
fn payoff_amount(&self, spot: f64, strike: f64) -> f64
Source§fn path_payoff_var<'t>(
&self,
_path: &[Var<'t>],
_strike: f64,
) -> Option<Var<'t>>
fn path_payoff_var<'t>( &self, _path: &[Var<'t>], _strike: f64, ) -> Option<Var<'t>>
path_payoff over tape variables, used by
the adjoint Monte Carlo Greeks
(montecarlo::aad_greeks). None
(the default) opts a payoff out: discontinuous payoffs (barrier,
binary, autocallable) must stay out, because the
almost-everywhere derivative of an indicator is zero — their
Greeks come from the bump stencils instead.