41 ") must be greater than reference date (" <<
48 const Date& referenceDate,
51 : exerciseDate_(
d), dc_(
std::move(dc)), volatilityType_(type), shift_(shift) {
65 : isFloating_(false), dc_(
std::move(dc)), exerciseTime_(exerciseTime), volatilityType_(type),
68 "expiry time must be positive: " <<
74 Real discount)
const {
77 "smile section must provide atm level to compute option price");
93 Real kl = std::max(strike-gap/2.0,m);
101 Real kl = std::max(strike-gap/2.0,m);
110 "smile section must provide atm level to compute option vega");
116 QL_FAIL(
"vega for normal smilesection not yet implemented");
125 "smile section must provide atm level to compute converted volatilties");
136 type, strike, atm, premium, premiumAtm, 1.0,
shift) /
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
DateProxy & evaluationDate()
the date at which pricing is to be performed.
static Settings & instance()
access to the unique instance
virtual Real digitalOptionPrice(Rate strike, Option::Type type=Option::Call, Real discount=1.0, Real gap=1.0e-5) const
virtual const Date & referenceDate() const
virtual Time exerciseTime() const
Volatility volatility(Rate strike) const
virtual Real vega(Rate strike, Real discount=1.0) const
virtual VolatilityType volatilityType() const
virtual Real atmLevel() const =0
virtual Real density(Rate strike, Real discount=1.0, Real gap=1.0E-4) const
virtual void initializeExerciseTime() const
virtual Rate shift() const
virtual Real optionPrice(Rate strike, Option::Type type=Option::Call, Real discount=1.0) const
VolatilityType volatilityType_
floating-point comparisons
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
LinearInterpolation variance
Real Time
continuous quantity with 1-year units
Real blackFormulaImpliedStdDevChambers(Option::Type optionType, Real strike, Real forward, Real blackPrice, Real blackAtmPrice, Real discount, Real displacement)
Real bachelierBlackFormula(Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount)
Real blackFormulaImpliedStdDev(Option::Type optionType, Real strike, Real forward, Real blackPrice, Real discount, Real displacement, Real guess, Real accuracy, Natural maxIterations)
bool close(const Quantity &m1, const Quantity &m2, Size n)
Real blackFormulaVolDerivative(Rate strike, Rate forward, Real stdDev, Real expiry, Real discount, Real displacement)
Real blackFormula(Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount, Real displacement)
Real bachelierBlackFormulaImpliedVol(Option::Type optionType, Real strike, Real forward, Real tte, Real bachelierPrice, Real discount)
global repository for run-time library settings
Smile section base class.