DatedOISRateHelper::DatedOISRateHelper( const Date& startDate, const Date& endDate, const Handle<Quote>& fixedRate, const boost::shared_ptr<OvernightIndex>& overnightIndex, const Handle<YieldTermStructure>& discount) : RateHelper(fixedRate), discountHandle_(discount) { registerWith(overnightIndex); registerWith(discountHandle_); // dummy OvernightIndex with curve/swap arguments // review here boost::shared_ptr<IborIndex> clonedIborIndex = overnightIndex->clone(termStructureHandle_); shared_ptr<OvernightIndex> clonedOvernightIndex = boost::dynamic_pointer_cast<OvernightIndex>(clonedIborIndex); // input discount curve Handle might be empty now but it could // be assigned a curve later; use a RelinkableHandle here swap_ = MakeOIS(Period(), clonedOvernightIndex, 0.0) .withDiscountingTermStructure(discountRelinkableHandle_) .withEffectiveDate(startDate) .withTerminationDate(endDate); earliestDate_ = swap_->startDate(); latestDate_ = swap_->maturityDate(); }
boost::shared_ptr<OvernightIndexedSwap> OvernightIndexedSwapIndex::underlyingSwap(const Date& fixingDate) const { QL_REQUIRE(fixingDate!=Date(), "null fixing date"); // caching mechanism if (lastFixingDate_!=fixingDate) { Rate fixedRate = 0.0; lastSwap_ = MakeOIS(tenor_, overnightIndex_, fixedRate) .withEffectiveDate(valueDate(fixingDate)) .withFixedLegDayCount(dayCounter_); lastFixingDate_ = fixingDate; } return lastSwap_; }
void OISRateHelper::initializeDates() { // dummy OvernightIndex with curve/swap arguments // review here boost::shared_ptr<IborIndex> clonedIborIndex = overnightIndex_->clone(termStructureHandle_); shared_ptr<OvernightIndex> clonedOvernightIndex = boost::dynamic_pointer_cast<OvernightIndex>(clonedIborIndex); swap_ = MakeOIS(tenor_, clonedOvernightIndex, 0.0) .withSettlementDays(settlementDays_) .withDiscountingTermStructure(termStructureHandle_); earliestDate_ = swap_->startDate(); latestDate_ = swap_->maturityDate(); }
void OISRateHelper::initializeDates() { // dummy OvernightIndex with curve/swap arguments // review here boost::shared_ptr<IborIndex> clonedIborIndex = overnightIndex_->clone(termStructureHandle_); shared_ptr<OvernightIndex> clonedOvernightIndex = boost::dynamic_pointer_cast<OvernightIndex>(clonedIborIndex); // input discount curve Handle might be empty now but it could // be assigned a curve later; use a RelinkableHandle here swap_ = MakeOIS(tenor_, clonedOvernightIndex, 0.0) .withDiscountingTermStructure(discountRelinkableHandle_) .withSettlementDays(settlementDays_); earliestDate_ = swap_->startDate(); latestDate_ = swap_->maturityDate(); }
DatedOISRateHelper::DatedOISRateHelper( const Date& startDate, const Date& endDate, const Handle<Quote>& fixedRate, const boost::shared_ptr<OvernightIndex>& overnightIndex) : RateHelper(fixedRate) { registerWith(overnightIndex); // dummy OvernightIndex with curve/swap arguments // review here boost::shared_ptr<IborIndex> clonedIborIndex = overnightIndex->clone(termStructureHandle_); shared_ptr<OvernightIndex> clonedOvernightIndex = boost::dynamic_pointer_cast<OvernightIndex>(clonedIborIndex); swap_ = MakeOIS(Period(), clonedOvernightIndex, 0.0) .withEffectiveDate(startDate) .withTerminationDate(endDate) .withDiscountingTermStructure(termStructureHandle_); earliestDate_ = swap_->startDate(); latestDate_ = swap_->maturityDate(); }