VanillaSwap::VanillaSwap( const shared_ptr<ObjectHandler::ValueObject>& properties, const QuantLib::Period& swapTenor, const shared_ptr<QuantLib::IborIndex>& index, QuantLib::Rate fixedRate, const QuantLib::Date& immDate, const QuantLib::DayCounter& fixDayCounter, QuantLib::Spread floatingLegSpread, bool permanent) : Swap(properties, permanent) { QuantLib::Date effectiveDate = immDate; if (effectiveDate==QuantLib::Date()) effectiveDate = QuantLib::IMM::nextDate(); QuantLib::Date terminationDate = effectiveDate+swapTenor; terminationDate = QuantLib::Date::nthWeekday(3, QuantLib::Wednesday, terminationDate.month(), terminationDate.year()); libraryObject_ = MakeVanillaSwap(swapTenor, index, fixedRate) .withEffectiveDate(effectiveDate) .withTerminationDate(terminationDate) .withRule(QuantLib::DateGeneration::ThirdWednesday) .withFixedLegDayCount(fixDayCounter) .withFloatingLegSpread(floatingLegSpread) .operator shared_ptr<QuantLib::VanillaSwap>(); }
bool MonthlyFixingCurve::containsARateSetOn(QuantLib::Date date) const { return FixingRateSource::containsARateSetOn(Date(1, date.month(), date.year())); }
double MonthlyFixingCurve::getRateSetOn(QuantLib::Date date) const { return FixingRateSource::getRateSetOn(Date(1, date.month(), date.year())); }
std::string BondTableModel::dateToString(QuantLib::Date d) const { std::stringstream stream; stream << d.dayOfMonth() << "-" << d.month() << "-" << d.year(); return stream.str(); }