152
153 pillarDate_ = customPillarDate;
154
155 bool onIndexHasCurve = !
overnightIndex_->forwardingTermStructure().empty();
157 QL_REQUIRE(!(onIndexHasCurve && haveDiscountCurve), "Have both curves nothing to solve for.");
158
159 if (!onIndexHasCurve) {
161 overnightIndex_ = QuantLib::ext::dynamic_pointer_cast<OvernightIndex>(clonedIborIndex);
163 }
164
167
169 .withEffectiveDate(startDate)
170 .withTerminationDate(endDate)
174
175
176
182
183 earliestDate_ =
swap_->startDate();
184 maturityDate_ =
swap_->maturityDate();
185
186 Date lastPaymentDate = std::max(
swap_->overnightLeg().back()->date(),
swap_->fixedLeg().back()->date());
187 latestRelevantDate_ = std::max(maturityDate_, lastPaymentDate);
188
190 case Pillar::MaturityDate:
191 pillarDate_ = maturityDate_;
192 break;
193 case Pillar::LastRelevantDate:
194 pillarDate_ = latestRelevantDate_;
195 break;
196 case Pillar::CustomDate:
197
198 QL_REQUIRE(pillarDate_ >= earliestDate_, "pillar date (" << pillarDate_
199 << ") must be later "
200 "than or equal to the instrument's earliest date ("
201 << earliestDate_ << ")");
202 QL_REQUIRE(pillarDate_ <= latestRelevantDate_, "pillar date ("
203 << pillarDate_
204 << ") must be before "
205 "or equal to the instrument's latest relevant date ("
206 << latestRelevantDate_ << ")");
207 break;
208 default:
209 QL_FAIL(
"unknown Pillar::Choice(" << Integer(
pillarChoice_) <<
")");
210 }
211
212
213 latestDate_ = pillarDate_;
214}
BusinessDayConvention paymentAdjustment_
BusinessDayConvention fixedConvention_
QuantLib::ext::shared_ptr< OvernightIndex > overnightIndex_
bool telescopicValueDates_
DayCounter fixedDayCounter_
RelinkableHandle< YieldTermStructure > termStructureHandle_
Pillar::Choice pillarChoice_
Handle< YieldTermStructure > discountHandle_
QuantLib::ext::shared_ptr< OvernightIndexedSwap > swap_
DateGeneration::Rule rule_
Frequency paymentFrequency_