<kiyosi/market/context.hpp>
#include <kiyosi/market/context.hpp>make_pricing_context
Result<PricingContext> kiyosi::make_pricing_context(BlackScholesMertonParameters model_parameters, double spot_price, Timestamp valuation_time, TradingCalendar calendar)Creates a pricing context at an intraday valuation time with an explicit calendar. 返回值: The context, or an invalid_spot_price or invalid_date error.
make_pricing_context
Result<PricingContext> kiyosi::make_pricing_context(BlackScholesMertonParameters model_parameters, double spot_price, Timestamp valuation_time)Creates a pricing context at an intraday valuation time using weekdays_calendar(). 返回值: The context, or an invalid_spot_price or invalid_date error.
make_pricing_context
Result<PricingContext> kiyosi::make_pricing_context(BlackScholesMertonParameters model_parameters, double spot_price, Date valuation_date, TradingCalendar calendar)Creates a midnight pricing context for a date with an explicit calendar. 返回值: The context, or an invalid_spot_price or invalid_date error.
make_pricing_context
Result<PricingContext> kiyosi::make_pricing_context(BlackScholesMertonParameters model_parameters, double spot_price, Date valuation_date)Creates a midnight pricing context for a date using weekdays_calendar(). 返回值: The context, or an invalid_spot_price or invalid_date error.
kiyosi::PricingContext
class kiyosi::PricingContextValuation-time snapshot: model parameters, the observable spot, and the trading calendar.
成员
replace
Result<PricingContext> kiyosi::PricingContext::replace(const PricingContextChanges &changes={}) constReturns a validated owning copy with the supplied fields replaced. Uses make_pricing_context validation and error categories; never changes this object. Concurrent calls and reads follow the calendar contract, without concurrent assignment.
model_parameters
const BlackScholesMertonParameters & kiyosi::PricingContext::model_parameters() const noexceptReturns the Black-Scholes-Merton model parameters.
spot_price
double kiyosi::PricingContext::spot_price() const noexceptReturns the positive observable spot price.
valuation_date
Date kiyosi::PricingContext::valuation_date() const noexceptReturns the civil date containing the valuation time.
valuation_time
Timestamp kiyosi::PricingContext::valuation_time() const noexceptReturns the valuation timestamp.
calendar
const TradingCalendar & kiyosi::PricingContext::calendar() const noexceptReturns the trading calendar.
kiyosi::PricingContextChanges
struct kiyosi::PricingContextChangesFields to replace; absent fields retain their current values, including the calendar.
成员
model_parameters
std::optional<BlackScholesMertonParameters> kiyosi::PricingContextChanges::model_parametersspot_price
std::optional<double> kiyosi::PricingContextChanges::spot_pricevaluation_time
std::optional<Timestamp> kiyosi::PricingContextChanges::valuation_timecalendar
std::optional<TradingCalendar> kiyosi::PricingContextChanges::calendar