<kiyosi/instruments/accumulator.hpp>
#include <kiyosi/instruments/accumulator.hpp>make_accumulator
Result<Accumulator> kiyosi::make_accumulator(AccumulatorTerms terms)Creates a validated accumulator contract. 参数
terms— Contract terms.
返回值: The accumulator, or an input-validation error.
kiyosi::Accumulator
class kiyosi::AccumulatorOutstanding forward accrual that buys a fixed daily quantity, accelerating below strike and terminating once spot reaches the knock-out level. Do not value an already terminated contract; prices exclude cashflows settled before valuation.
成员
replace
Result<Accumulator> kiyosi::Accumulator::replace(double accumulated_quantity) constReturns a validated owning copy with only the supplied history replaced. Preserves all contract terms and never changes this object, including on failure. History is caller-supplied; time consistency is checked during pricing. Concurrent calls and reads are safe without concurrent assignment or mutation. Uses constructor validation and error categories; zero is a known value, not unknown history.
strike
double kiyosi::Accumulator::strike() const noexceptReturns the purchase strike.
knock_out_level
double kiyosi::Accumulator::knock_out_level() const noexceptReturns the knock-out spot level.
daily_quantity
double kiyosi::Accumulator::daily_quantity() const noexceptReturns the base quantity accrued per trading day.
acceleration_factor
double kiyosi::Accumulator::acceleration_factor() const noexceptReturns the below-strike quantity multiplier.
accumulated_quantity
double kiyosi::Accumulator::accumulated_quantity() const noexceptReturns the quantity accrued before valuation.
effective_date
Date kiyosi::Accumulator::effective_date() const noexceptReturns the first date of the contract life.
expiry_date
Date kiyosi::Accumulator::expiry_date() const noexceptReturns the final date of the contract life.
kiyosi::AccumulatorTerms
struct kiyosi::AccumulatorTermsInput terms used to construct an Accumulator.
成员
strike
double kiyosi::AccumulatorTerms::strikePositive purchase strike.
knock_out_level
double kiyosi::AccumulatorTerms::knock_out_levelPositive spot level that terminates accrual.
daily_quantity
double kiyosi::AccumulatorTerms::daily_quantityNon-negative base quantity accrued per trading day.
acceleration_factor
double kiyosi::AccumulatorTerms::acceleration_factorNon-negative quantity multiplier below strike.
accumulated_quantity
double kiyosi::AccumulatorTerms::accumulated_quantityCaller-asserted non-negative quantity already accrued; zero means none.
effective_date
Date kiyosi::AccumulatorTerms::effective_dateFirst date of the contract life.
expiry_date
Date kiyosi::AccumulatorTerms::expiry_dateFinal date of the contract life.