Skip to content

Commit c05ab0a

Browse files
committed
QPR-13768 fixes
1 parent f276b2d commit c05ab0a

3 files changed

Lines changed: 16 additions & 13 deletions

File tree

OREData/ored/marketdata/capfloorvolcurve.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,13 @@ CapFloorVolCurve::CapFloorVolCurve(
114114
QL_FAIL("Unexpected type (" << static_cast<int>(config->type()) << ") for cap floor config "
115115
<< config->curveID());
116116
}
117-
// Turn on or off extrapolation
118-
capletVol_->enableExtrapolation(config->extrapolate());
117+
118+
capletVol_->enableExtrapolation(true);
119119
}
120120

121+
// force bootstrap so that errors are thrown during the build, not later
122+
capletVol_->volatility(QL_EPSILON, capletVol_->minStrike());
123+
121124
if (buildCalibrationInfo) {
122125
this->buildCalibrationInfo(asof, curveConfigs, config, iborIndex);
123126
}
@@ -130,8 +133,6 @@ CapFloorVolCurve::CapFloorVolCurve(
130133
QL_FAIL("cap/floor vol curve building failed: unknown error");
131134
}
132135

133-
// force bootstrap so that errors are thrown during the build, not later
134-
capletVol_->volatility(QL_EPSILON, capletVol_->minStrike());
135136
}
136137

137138
void CapFloorVolCurve::buildProxyCurve(

QuantExt/qle/termstructures/oiscapfloorhelper.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,24 +109,25 @@ void OISCapFloorHelper::setTermStructure(OptionletVolatilityStructure* ovts) {
109109
Rate atm = CashFlows::atmRate(getOisCapFloorUnderlying(capFloor_), **discountHandle_, false);
110110
CapFloor::Type capFloorType = type_ == CapFloorHelper::Cap ? CapFloor::Cap : CapFloor::Floor;
111111
capFloor_ = MakeOISCapFloor(capFloorType, tenor_, index_, rateComputationPeriod_, atm)
112-
.withTelescopicValueDates(true)
113112
.withEffectiveDate(effectiveDate_)
113+
.withTelescopicValueDates(true)
114114
.withRule(DateGeneration::Rule::Forward);
115115
capFloorCopy_ = MakeOISCapFloor(capFloorType, tenor_, index_, rateComputationPeriod_, atm)
116-
.withTelescopicValueDates(true)
117-
.withEffectiveDate(effectiveDate_)
118-
.withRule(DateGeneration::Rule::Forward);
116+
.withEffectiveDate(effectiveDate_)
117+
.withTelescopicValueDates(true)
118+
.withRule(DateGeneration::Rule::Forward);
119119
} else if (type_ == CapFloorHelper::Automatic && quoteType_ != CapFloorHelper::Premium) {
120120
// If the helper is set to automatically choose the underlying instrument type, do it now based on the ATM rate
121121
Rate atm = CashFlows::atmRate(getOisCapFloorUnderlying(capFloor_), **discountHandle_, false);
122122
CapFloor::Type capFloorType = atm > strike_ ? CapFloor::Floor : CapFloor::Cap;
123123
capFloor_ = MakeOISCapFloor(capFloorType, tenor_, index_, rateComputationPeriod_, strike_)
124+
.withEffectiveDate(effectiveDate_)
124125
.withTelescopicValueDates(true)
125-
.withEffectiveDate(effectiveDate_);
126+
.withRule(DateGeneration::Rule::Forward);
126127
capFloorCopy_ = MakeOISCapFloor(capFloorType, tenor_, index_, rateComputationPeriod_, strike_)
127-
.withTelescopicValueDates(true)
128-
.withEffectiveDate(effectiveDate_)
129-
.withRule(DateGeneration::Rule::Forward);
128+
.withEffectiveDate(effectiveDate_)
129+
.withTelescopicValueDates(true)
130+
.withRule(DateGeneration::Rule::Forward);
130131

131132
for (auto const& c : capFloor_) {
132133
auto cpn = QuantLib::ext::dynamic_pointer_cast<Coupon>(c);

QuantExt/qle/termstructures/optionletstripper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ void OptionletStripper::populateDates() const {
161161
MakeOISCapFloor(CapFloor::Cap, capFloorLengths_[i], QuantLib::ext::dynamic_pointer_cast<OvernightIndex>(index_),
162162
rateComputationPeriod_, 0.04)
163163
.withTelescopicValueDates(true)
164-
.withSettlementDays(onCapSettlementDays_);
164+
.withSettlementDays(onCapSettlementDays_)
165+
.withRule(DateGeneration::Rule::Forward);
165166
auto lastCoupon = QuantLib::ext::dynamic_pointer_cast<CappedFlooredOvernightIndexedCoupon>(dummyCap.back());
166167
QL_REQUIRE(lastCoupon, "OptionletStripper::populateDates(): expected CappedFlooredOvernightIndexedCoupon");
167168
optionletDates_[i] = std::max(referenceDate + 1, lastCoupon->underlying()->fixingDates().front());

0 commit comments

Comments
 (0)