跳转到正文

<kiyosi/instruments/barrier/terms.hpp> ​

cpp
#include <kiyosi/instruments/barrier/terms.hpp>

BarrierType ​

cpp
enum class BarrierType

Direction and activation behavior of a barrier.

枚举值

  • up_and_in — Activates when spot reaches or exceeds the barrier.
  • up_and_out — Terminates when spot reaches or exceeds the barrier.
  • down_and_in — Activates when spot reaches or falls below the barrier.
  • down_and_out — Terminates when spot reaches or falls below the barrier.

ObservationMode ​

cpp
enum class ObservationMode

Barrier monitoring frequency.

枚举值

  • continuous — Monitor continuously throughout the contract life.
  • scheduled — Monitor only at 00:00 UTC on explicit observation dates.

BarrierTouchState ​

cpp
enum class BarrierTouchState

Barrier observations strictly before the valuation time.

枚举值

  • untouched — No prior observation breached the barrier.
  • touched — A prior observation breached the barrier.

RebateTiming ​

cpp
enum class RebateTiming

Payment timing for a barrier-option rebate.

枚举值

  • at_hit — Pay when the barrier is hit.
  • at_expiry — Pay at contract expiry.

SettlementTiming ​

cpp
enum class SettlementTiming

Settlement timing for a touch option.

枚举值

  • at_hit — Settle when the barrier is hit.
  • at_expiry — Settle at contract expiry.

is_up_barrier ​

cpp
bool kiyosi::is_up_barrier(BarrierType kind) noexcept

Tests whether a barrier is triggered by upward spot movement. 返回值: true for up-and-in and up-and-out barriers.

is_knock_in_barrier ​

cpp
bool kiyosi::is_knock_in_barrier(BarrierType kind) noexcept

Tests whether a barrier activates rather than terminates the contract. 返回值: true for up-and-in and down-and-in barriers.

kiyosi::BarrierTerms ​

cpp
class kiyosi::BarrierTerms

Trigger level, knock direction, and monitoring schedule shared by every barrier contract.

成员 ​

barrier_level ​

cpp
double kiyosi::BarrierTerms::barrier_level() const noexcept

Returns the positive barrier level.

barrier_type ​

cpp
BarrierType kiyosi::BarrierTerms::barrier_type() const noexcept

Returns the barrier direction and activation behavior.

observation_mode ​

cpp
kiyosi::ObservationMode kiyosi::BarrierTerms::observation_mode() const noexcept

Returns the monitoring frequency.

observation_schedule ​

cpp
const ObservationSchedule & kiyosi::BarrierTerms::observation_schedule() const noexcept

Returns the validated monitoring schedule.

observation_dates ​

cpp
const std::vector<Date> & kiyosi::BarrierTerms::observation_dates() const noexcept

Returns the ordered monitoring dates; empty for continuous monitoring.

effective_date ​

cpp
Date kiyosi::BarrierTerms::effective_date() const noexcept

Returns the first date of the contract life.

expiry_date ​

cpp
Date kiyosi::BarrierTerms::expiry_date() const noexcept

Returns the final date of the contract life.

touch_state ​

cpp
std::optional<BarrierTouchState> kiyosi::BarrierTerms::touch_state() const noexcept

Returns the caller-supplied state before valuation, if supplied.

was_touched_before ​

cpp
Result<bool> kiyosi::BarrierTerms::was_touched_before(Timestamp valuation_time) const

Resolves prior history, rejecting missing or impossible history.

is_up ​

cpp
bool kiyosi::BarrierTerms::is_up() const noexcept

Returns whether this is an upward barrier.

is_knock_in ​

cpp
bool kiyosi::BarrierTerms::is_knock_in() const noexcept

Returns whether this is a knock-in barrier.

is_continuous ​

cpp
bool kiyosi::BarrierTerms::is_continuous() const noexcept

Returns whether monitoring is continuous.

mean_observation_year_fraction ​

cpp
double kiyosi::BarrierTerms::mean_observation_year_fraction() const noexcept

Mean spacing between monitoring dates, used for the BGK discrete-barrier shift.

is_monitored_on ​

cpp
bool kiyosi::BarrierTerms::is_monitored_on(Date date) const noexcept

Tests whether the barrier is monitored on a date. 参数

  • date — Date to test.

返回值: true within the contract life for continuous monitoring, or on a scheduled observation date.

is_monitored_at ​

cpp
bool kiyosi::BarrierTerms::is_monitored_at(Timestamp time) const noexcept

Tests whether monitoring occurs at this exact valuation instant.

is_breached_by ​

cpp
bool kiyosi::BarrierTerms::is_breached_by(double spot) const noexcept

Tests whether a spot lies on the triggered side of the barrier. 参数

  • spot — Spot value to test.

返回值: true when spot breaches the barrier.