<kiyosi/instruments/barrier/binary.hpp>
#include <kiyosi/instruments/barrier/binary.hpp>default_touch_observation_mode
ObservationMode kiyosi::default_touch_observation_modeDefault monitoring frequency for Touch factories.
default_one_touch_settlement_timing
SettlementTiming kiyosi::default_one_touch_settlement_timingDefault settlement timing for one-touch factories.
make_cash_binary_barrier_option
Result<BinaryBarrierOption> kiyosi::make_cash_binary_barrier_option(BinaryBarrierTerms terms, double payout)Creates a validated cash-paying binary barrier option. 参数
terms— Strike, life, and barrier terms.payout— Positive finite cash payout.
返回值: The option, or an input-validation error.
make_asset_binary_barrier_option
Result<BinaryBarrierOption> kiyosi::make_asset_binary_barrier_option(BinaryBarrierTerms terms)Creates a validated asset-paying binary barrier option. 返回值: The option, or an input-validation error.
make_cash_one_touch_up
Result<TouchOption> kiyosi::make_cash_one_touch_up(Date effective_date, Date expiry_date, double barrier_level, double payout, kiyosi::SettlementTiming settlement_timing=default_one_touch_settlement_timing, kiyosi::ObservationMode observation_mode=default_touch_observation_mode, std::vector<Date> observation_dates={}, std::optional<BarrierTouchState> touch_state=std::nullopt)Creates an up one-touch option with a fixed cash payout. 返回值: The option, or an input-validation error.
make_cash_one_touch_down
Result<TouchOption> kiyosi::make_cash_one_touch_down(Date effective_date, Date expiry_date, double barrier_level, double payout, kiyosi::SettlementTiming settlement_timing=default_one_touch_settlement_timing, kiyosi::ObservationMode observation_mode=default_touch_observation_mode, std::vector<Date> observation_dates={}, std::optional<BarrierTouchState> touch_state=std::nullopt)Creates a down one-touch option with a fixed cash payout. 返回值: The option, or an input-validation error.
make_cash_no_touch_up
Result<TouchOption> kiyosi::make_cash_no_touch_up(Date effective_date, Date expiry_date, double barrier_level, double payout, kiyosi::ObservationMode observation_mode=default_touch_observation_mode, std::vector<Date> observation_dates={}, std::optional<BarrierTouchState> touch_state=std::nullopt)Creates an up no-touch option with a fixed cash payout at expiry. 返回值: The option, or an input-validation error.
make_cash_no_touch_down
Result<TouchOption> kiyosi::make_cash_no_touch_down(Date effective_date, Date expiry_date, double barrier_level, double payout, kiyosi::ObservationMode observation_mode=default_touch_observation_mode, std::vector<Date> observation_dates={}, std::optional<BarrierTouchState> touch_state=std::nullopt)Creates a down no-touch option with a fixed cash payout at expiry. 返回值: The option, or an input-validation error.
make_asset_one_touch_up
Result<TouchOption> kiyosi::make_asset_one_touch_up(Date effective_date, Date expiry_date, double barrier_level, kiyosi::SettlementTiming settlement_timing=default_one_touch_settlement_timing, kiyosi::ObservationMode observation_mode=default_touch_observation_mode, std::vector<Date> observation_dates={}, std::optional<BarrierTouchState> touch_state=std::nullopt)Creates an up one-touch option paying the underlying asset. 返回值: The option, or an input-validation error.
make_asset_one_touch_down
Result<TouchOption> kiyosi::make_asset_one_touch_down(Date effective_date, Date expiry_date, double barrier_level, kiyosi::SettlementTiming settlement_timing=default_one_touch_settlement_timing, kiyosi::ObservationMode observation_mode=default_touch_observation_mode, std::vector<Date> observation_dates={}, std::optional<BarrierTouchState> touch_state=std::nullopt)Creates a down one-touch option paying the underlying asset. 返回值: The option, or an input-validation error.
make_asset_no_touch_up
Result<TouchOption> kiyosi::make_asset_no_touch_up(Date effective_date, Date expiry_date, double barrier_level, kiyosi::ObservationMode observation_mode=default_touch_observation_mode, std::vector<Date> observation_dates={}, std::optional<BarrierTouchState> touch_state=std::nullopt)Creates an up no-touch option paying the underlying asset at expiry. 返回值: The option, or an input-validation error.
make_asset_no_touch_down
Result<TouchOption> kiyosi::make_asset_no_touch_down(Date effective_date, Date expiry_date, double barrier_level, kiyosi::ObservationMode observation_mode=default_touch_observation_mode, std::vector<Date> observation_dates={}, std::optional<BarrierTouchState> touch_state=std::nullopt)Creates a down no-touch option paying the underlying asset at expiry. 返回值: The option, or an input-validation error.
kiyosi::BinaryBarrierOption
class kiyosi::BinaryBarrierOptionStrike-based binary option whose payoff also depends on a barrier_level event.
成员
replace
Result<BinaryBarrierOption> kiyosi::BinaryBarrierOption::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::BinaryBarrierOption::option_type() const noexceptReturns the call-or-put direction.
strike
double kiyosi::BinaryBarrierOption::strike() const noexceptReturns the positive strike price.
payoff
const BinaryPayoff & kiyosi::BinaryBarrierOption::payoff() const noexceptReturns the cash-or-asset payoff.
payoff_type
PayoffType kiyosi::BinaryBarrierOption::payoff_type() const noexceptReturns the payoff denomination.
barrier_terms
const BarrierTerms & kiyosi::BinaryBarrierOption::barrier_terms() const noexceptReturns the validated barrier terms.
barrier_level
double kiyosi::BinaryBarrierOption::barrier_level() const noexceptReturns the positive barrier level.
barrier_type
BarrierType kiyosi::BinaryBarrierOption::barrier_type() const noexceptReturns the barrier direction and activation behavior.
observation_mode
kiyosi::ObservationMode kiyosi::BinaryBarrierOption::observation_mode() const noexceptReturns the monitoring frequency.
observation_schedule
const ObservationSchedule & kiyosi::BinaryBarrierOption::observation_schedule() const noexceptReturns the validated observation schedule.
observation_dates
const std::vector<Date> & kiyosi::BinaryBarrierOption::observation_dates() const noexceptReturns the ordered observation dates.
mean_observation_year_fraction
double kiyosi::BinaryBarrierOption::mean_observation_year_fraction() const noexceptReturns the average spacing between scheduled observations in years.
effective_date
Date kiyosi::BinaryBarrierOption::effective_date() const noexceptReturns the first date of the contract life.
expiry_date
Date kiyosi::BinaryBarrierOption::expiry_date() const noexceptReturns the final date of the contract life.
touch_state
std::optional<BarrierTouchState> kiyosi::BinaryBarrierOption::touch_state() const noexceptReturns the state of observations before valuation, if supplied.
kiyosi::BinaryBarrierTerms
struct kiyosi::BinaryBarrierTermsInput terms shared by cash and asset binary barrier options.
成员
option_type
OptionType kiyosi::BinaryBarrierTerms::option_typeCall-or-put direction.
strike
double kiyosi::BinaryBarrierTerms::strikePositive binary strike.
effective_date
Date kiyosi::BinaryBarrierTerms::effective_dateFirst date of the contract life.
expiry_date
Date kiyosi::BinaryBarrierTerms::expiry_dateFinal date of the contract life.
barrier_level
double kiyosi::BinaryBarrierTerms::barrier_levelPositive barrier trigger level.
barrier_type
BarrierType kiyosi::BinaryBarrierTerms::barrier_typeBarrier direction and activation behavior.
observation_mode
kiyosi::ObservationMode kiyosi::BinaryBarrierTerms::observation_modeMonitoring frequency.
observation_dates
std::vector<Date> kiyosi::BinaryBarrierTerms::observation_datesOrdered dates for scheduled monitoring.
touch_state
std::optional<BarrierTouchState> kiyosi::BinaryBarrierTerms::touch_stateHistory before valuation, if supplied.
kiyosi::TouchOption
class kiyosi::TouchOptionStrike-free one-touch or no-touch contract paying cash or the asset.
成员
replace
Result<TouchOption> kiyosi::TouchOption::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.
payoff
const BinaryPayoff & kiyosi::TouchOption::payoff() const noexceptReturns the cash-or-asset payoff.
payoff_type
PayoffType kiyosi::TouchOption::payoff_type() const noexceptReturns the payoff denomination.
settlement_timing
kiyosi::SettlementTiming kiyosi::TouchOption::settlement_timing() const noexceptReturns when the payoff settles.
barrier_terms
const BarrierTerms & kiyosi::TouchOption::barrier_terms() const noexceptReturns the validated barrier terms.
barrier_level
double kiyosi::TouchOption::barrier_level() const noexceptReturns the positive barrier level.
is_one_touch
bool kiyosi::TouchOption::is_one_touch() const noexceptReturns whether this contract pays when the barrier is touched.
is_up
bool kiyosi::TouchOption::is_up() const noexceptReturns whether this is an upward barrier.
observation_mode
kiyosi::ObservationMode kiyosi::TouchOption::observation_mode() const noexceptReturns the monitoring frequency.
observation_schedule
const ObservationSchedule & kiyosi::TouchOption::observation_schedule() const noexceptReturns the validated observation schedule.
observation_dates
const std::vector<Date> & kiyosi::TouchOption::observation_dates() const noexceptReturns the ordered observation dates.
mean_observation_year_fraction
double kiyosi::TouchOption::mean_observation_year_fraction() const noexceptReturns the average spacing between scheduled observations in years.
effective_date
Date kiyosi::TouchOption::effective_date() const noexceptReturns the first date of the contract life.
expiry_date
Date kiyosi::TouchOption::expiry_date() const noexceptReturns the final date of the contract life.
touch_state
std::optional<BarrierTouchState> kiyosi::TouchOption::touch_state() const noexceptReturns the state of observations before valuation, if supplied.