19#include <ql/time/imm.hpp>
20#include <ql/utilities/null_deleter.hpp>
28 for (Size j = 0; j < i; j++) {
29 imm = IMM::nextDate(imm,
true);
35 const QuantLib::ext::shared_ptr<IborIndex>& i, Pillar::Choice pillarChoice,
36 Date customPillarDate)
43 pillarDate_ = customPillarDate;
48 QL_REQUIRE(termStructure_ != 0,
"term structure not set");
55 bool observer =
false;
57 QuantLib::ext::shared_ptr<YieldTermStructure> temp(t, null_deleter());
60 RelativeDateRateHelper::setTermStructure(t);
66 Date referenceDate =
iborIndex_->fixingCalendar().adjust(evaluationDate_);
67 Date spotDate =
iborIndex_->fixingCalendar().advance(referenceDate,
iborIndex_->fixingDays() * Days);
73 latestRelevantDate_ =
iborIndex_->maturityDate(earliestDate_);
76 case Pillar::MaturityDate:
77 pillarDate_ = maturityDate_;
79 case Pillar::LastRelevantDate:
80 pillarDate_ = latestRelevantDate_;
82 case Pillar::CustomDate:
84 QL_REQUIRE(pillarDate_ >= earliestDate_,
"pillar date (" << pillarDate_
86 "than or equal to the instrument's earliest date ("
87 << earliestDate_ <<
")");
88 QL_REQUIRE(pillarDate_ <= latestRelevantDate_,
"pillar date ("
90 <<
") must be before "
91 "or equal to the instrument's latest relevant date ("
92 << latestRelevantDate_ <<
")");
95 QL_FAIL(
"unknown Pillar::Choice(" << Integer(
pillarChoice_) <<
")");
98 latestDate_ = pillarDate_;
104 Visitor<ImmFraRateHelper>* v1 =
dynamic_cast<Visitor<ImmFraRateHelper>*
>(&v);
108 RateHelper::accept(v);
void setTermStructure(YieldTermStructure *) override
RelinkableHandle< YieldTermStructure > termStructureHandle_
Pillar::Choice pillarChoice_
void accept(AcyclicVisitor &) override
void initializeDates() override
Real impliedQuote() const override
ImmFraRateHelper(const Handle< Quote > &rate, const Size imm1, const Size imm2, const QuantLib::ext::shared_ptr< IborIndex > &iborIndex, Pillar::Choice pillar=Pillar::LastRelevantDate, Date customPillarDate=Date())
QuantLib::ext::shared_ptr< IborIndex > iborIndex_
Date getImmDate(Date asof, Size i)
RelativeDateBootstrapHelper< YieldTermStructure > RelativeDateRateHelper