<kiyosi/instruments/barrier/option.hpp>
#include <kiyosi/instruments/barrier/option.hpp>make_barrier_option
Result<BarrierOption> kiyosi::make_barrier_option(BarrierOptionTerms terms)Creates a validated barrier option. 返回值: The option, or an input-validation error.
kiyosi::BarrierOption
class kiyosi::BarrierOptionKnock-in or knock-out vanilla payoff with an optional rebate.
成员
replace
Result<BarrierOption> kiyosi::BarrierOption::replace(std::optional<BarrierTouchState> touch_state) 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. nullopt means unknown history; untouched means known absence of touches. Uses core barrier construction validation and error categories.
option_type
OptionType kiyosi::BarrierOption::option_type() const noexceptReturns the call-or-put direction.
strike
double kiyosi::BarrierOption::strike() const noexceptReturns the positive strike price.
rebate
double kiyosi::BarrierOption::rebate() const noexceptReturns the non-negative rebate.
rebate_timing
kiyosi::RebateTiming kiyosi::BarrierOption::rebate_timing() const noexceptReturns when the rebate is paid.
barrier_terms
const BarrierTerms & kiyosi::BarrierOption::barrier_terms() const noexceptReturns the validated barrier terms.
barrier_level
double kiyosi::BarrierOption::barrier_level() const noexceptReturns the positive barrier level.
barrier_type
BarrierType kiyosi::BarrierOption::barrier_type() const noexceptReturns the barrier direction and activation behavior.
observation_mode
kiyosi::ObservationMode kiyosi::BarrierOption::observation_mode() const noexceptReturns the monitoring frequency.
observation_schedule
const ObservationSchedule & kiyosi::BarrierOption::observation_schedule() const noexceptReturns the validated observation schedule.
observation_dates
const std::vector<Date> & kiyosi::BarrierOption::observation_dates() const noexceptReturns the ordered observation dates.
mean_observation_year_fraction
double kiyosi::BarrierOption::mean_observation_year_fraction() const noexceptReturns the average spacing between scheduled observations in years.
effective_date
Date kiyosi::BarrierOption::effective_date() const noexceptReturns the first date of the contract life.
expiry_date
Date kiyosi::BarrierOption::expiry_date() const noexceptReturns the final date of the contract life.
touch_state
std::optional<BarrierTouchState> kiyosi::BarrierOption::touch_state() const noexceptReturns the state of observations before valuation, if supplied.
kiyosi::BarrierOptionTerms
struct kiyosi::BarrierOptionTermsInput terms used to construct a BarrierOption.
成员
option_type
OptionType kiyosi::BarrierOptionTerms::option_typeCall-or-put direction.
strike
double kiyosi::BarrierOptionTerms::strikePositive option strike.
effective_date
Date kiyosi::BarrierOptionTerms::effective_dateFirst date of the contract life.
expiry_date
Date kiyosi::BarrierOptionTerms::expiry_dateFinal date of the contract life.
barrier_level
double kiyosi::BarrierOptionTerms::barrier_levelPositive barrier trigger level.
barrier_type
BarrierType kiyosi::BarrierOptionTerms::barrier_typeBarrier direction and activation behavior.
rebate
double kiyosi::BarrierOptionTerms::rebateNon-negative cash rebate.
rebate_timing
kiyosi::RebateTiming kiyosi::BarrierOptionTerms::rebate_timingRebate payment timing.
observation_mode
kiyosi::ObservationMode kiyosi::BarrierOptionTerms::observation_modeMonitoring frequency.
observation_dates
std::vector<Date> kiyosi::BarrierOptionTerms::observation_datesOrdered dates for scheduled monitoring.
touch_state
std::optional<BarrierTouchState> kiyosi::BarrierOptionTerms::touch_stateHistory before valuation, if supplied.