Skip to content

Commit

Permalink
Merge 38da65f into d9e5520
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Oct 27, 2022
2 parents d9e5520 + 38da65f commit f69bb6e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ql/cashflows/inflationcouponpricer.cpp
Expand Up @@ -96,7 +96,7 @@ namespace QuantLib {
Real YoYInflationCouponPricer::optionletRate(Option::Type optionType,
Real effStrike) const {
Date fixingDate = coupon_->fixingDate();
if (fixingDate <= Settings::instance().evaluationDate()) {
if (fixingDate <= capletVolatility()->baseDate()) {
// the amount is determined
Real a, b;
if (optionType==Option::Call) {
Expand All @@ -109,11 +109,12 @@ namespace QuantLib {
return std::max(a - b, 0.0);
} else {
// not yet determined, use Black/DD1/Bachelier/whatever from Impl
QL_REQUIRE(!capletVolatility().empty(),
"missing optionlet volatility");
QL_REQUIRE(!capletVolatility().empty(), "missing optionlet volatility");

Real stdDev =
std::sqrt(capletVolatility()->totalVariance(fixingDate,
effStrike));
std::sqrt(capletVolatility()->totalVariance(fixingDate,
effStrike,
Period(0, Days)));
return optionletPriceImp(optionType,
effStrike,
adjustedFixing(),
Expand Down

0 comments on commit f69bb6e

Please sign in to comment.