25#include <ql/cashflow.hpp>
26#include <ql/cashflows/averagebmacoupon.hpp>
27#include <ql/cashflows/capflooredcoupon.hpp>
28#include <ql/cashflows/cpicoupon.hpp>
29#include <ql/cashflows/digitalcoupon.hpp>
30#include <ql/cashflows/floatingratecoupon.hpp>
31#include <ql/cashflows/inflationcoupon.hpp>
32#include <ql/cashflows/overnightindexedcoupon.hpp>
33#include <ql/cashflows/simplecashflow.hpp>
34#include <ql/cashflows/yoyinflationcoupon.hpp>
35#include <ql/experimental/coupons/cmsspreadcoupon.hpp>
36#include <ql/experimental/coupons/strippedcapflooredcoupon.hpp>
37#include <ql/time/calendars/weekendsonly.hpp>
73set<Date> generateLookbackDates(
const Date& asof,
const Period& lookbackPeriod,
const Calendar&
calendar) {
76 Date lookback =
calendar.advance(asof, -lookbackPeriod);
78 TLOG(
"Adding date " << io::iso_date(lookback) <<
" to fixings.");
79 dates.insert(lookback);
80 lookback =
calendar.advance(lookback, 1 * Days);
81 }
while (lookback <= asof);
94RequiredFixings::FixingDates needsForecast(
const Date& fixingDate,
const Date& today,
const bool interpolated,
95 const Frequency frequency,
const Period& availabilityLag,
96 const bool mandatory) {
98 RequiredFixings::FixingDates result;
100 Date todayMinusLag = today - availabilityLag;
101 Date historicalFixingKnown = inflationPeriod(todayMinusLag, frequency).first - 1;
103 pair<Date, Date> lim = inflationPeriod(fixingDate, frequency);
104 result.addDate(lim.first, mandatory);
107 if (fixingDate > lim.first) {
108 latestNeededDate += Period(frequency);
109 result.addDate(lim.second + 1, mandatory);
113 if (latestNeededDate <= historicalFixingKnown) {
116 }
else if (latestNeededDate > today) {
118 return RequiredFixings::FixingDates();
121 return RequiredFixings::FixingDates();
126void addZeroInflationDates(RequiredFixings::FixingDates& dates,
const Date& fixingDate,
const Date& today,
127 const bool indexInterpolated,
const Frequency indexFrequency,
128 const Period& indexAvailabilityLag,
const CPI::InterpolationType interpolation,
129 const Frequency f,
const bool mandatory) {
131 RequiredFixings::FixingDates fixingDates;
133 if (interpolation == CPI::AsIndex) {
135 needsForecast(fixingDate, today, indexInterpolated, indexFrequency, indexAvailabilityLag, mandatory);
137 pair<Date, Date> lim = inflationPeriod(fixingDate, f);
139 needsForecast(lim.first, today, indexInterpolated, indexFrequency, indexAvailabilityLag, mandatory);
140 if (interpolation == CPI::Linear) {
141 auto moreDates = needsForecast(lim.second + 1, today, indexInterpolated, indexFrequency,
142 indexAvailabilityLag, mandatory);
143 fixingDates.addDates(moreDates);
146 dates.addDates(fixingDates);
188 std::set<FixingEntry> newFixingDates;
189 std::set<ZeroInflationFixingEntry> newZeroInflationFixingDates;
190 std::set<InflationFixingEntry> newYoYInflationFixingDates;
192 f.payDate = Date::maxDate();
193 f.alwaysAddIfPaysOnSettlement =
true;
194 newFixingDates.insert(f);
197 f.payDate = Date::maxDate();
198 f.alwaysAddIfPaysOnSettlement =
true;
199 newZeroInflationFixingDates.insert(f);
202 f.payDate = Date::maxDate();
203 f.alwaysAddIfPaysOnSettlement =
true;
204 newYoYInflationFixingDates.insert(f);
214 std::set<FixingEntry> newFixingDates;
215 std::set<ZeroInflationFixingEntry> newZeroInflationFixingDates;
216 std::set<InflationFixingEntry> newYoYInflationFixingDates;
218 f.mandatory = mandatory;
219 newFixingDates.insert(f);
222 f.mandatory = mandatory;
223 newZeroInflationFixingDates.insert(f);
226 f.mandatory = mandatory;
227 newYoYInflationFixingDates.insert(f);
238 Date d = settlementDate == Date() ? Settings::instance().evaluationDate() : settlementDate;
242 std::string indexName = f.indexName;
244 Date payDate = f.payDate;
245 bool alwaysAddIfPaysOnSettlement = f.alwaysAddIfPaysOnSettlement;
249 SimpleCashFlow dummyCf(0.0, payDate);
250 if (!dummyCf.hasOccurred(d) || (alwaysAddIfPaysOnSettlement && dummyCf.date() == d)) {
251 f.payDate = Date::maxDate();
252 f.alwaysAddIfPaysOnSettlement =
true;
260 std::string indexName = f.indexName;
261 Date payDate = f.payDate;
262 bool alwaysAddIfPaysOnSettlement = f.alwaysAddIfPaysOnSettlement;
264 SimpleCashFlow dummyCf(0.0, payDate);
265 if (!dummyCf.hasOccurred(d) || (alwaysAddIfPaysOnSettlement && dummyCf.date() == d)) {
266 f.payDate = Date::maxDate();
267 f.alwaysAddIfPaysOnSettlement =
true;
275 std::string indexName = f.indexName;
276 Date payDate = f.payDate;
277 bool alwaysAddIfPaysOnSettlement = f.alwaysAddIfPaysOnSettlement;
279 SimpleCashFlow dummyCf(0.0, payDate);
280 if (!dummyCf.hasOccurred(d) || (alwaysAddIfPaysOnSettlement && dummyCf.date() == d)) {
281 f.payDate = Date::maxDate();
282 f.alwaysAddIfPaysOnSettlement =
true;
289std::map<std::string, RequiredFixings::FixingDates>
293 Date d = settlementDate == Date() ? Settings::instance().evaluationDate() : settlementDate;
295 std::map<std::string, FixingDates> result;
300 std::string indexName = f.indexName;
302 Date payDate = f.payDate;
303 bool alwaysAddIfPaysOnSettlement = f.alwaysAddIfPaysOnSettlement;
307 SimpleCashFlow dummyCf(0.0, payDate);
308 if (!dummyCf.hasOccurred(d) || (alwaysAddIfPaysOnSettlement && dummyCf.date() == d)) {
309 result[indexName].addDate(
fixingDate, f.mandatory);
316 std::string indexName = f.indexName;
318 Date payDate = f.payDate;
319 bool alwaysAddIfPaysOnSettlement = f.alwaysAddIfPaysOnSettlement;
320 bool indexInterpolated = f.indexInterpolated;
321 Frequency indexFrequency = f.indexFreq;
322 Period indexAvailabilityLag = f.availabilityLeg;
323 CPI::InterpolationType couponInterpolation = f.couponInterpolation;
324 Frequency couponFrequency = f.couponFrequency;
326 SimpleCashFlow dummyCf(0.0, payDate);
327 if (!dummyCf.hasOccurred(d) || (alwaysAddIfPaysOnSettlement && dummyCf.date() == d)) {
329 addZeroInflationDates(tmp,
fixingDate, d, indexInterpolated, indexFrequency, indexAvailabilityLag,
330 couponInterpolation, couponFrequency, f.mandatory);
332 result[indexName].addDates(tmp);
339 std::string indexName = f.indexName;
341 Date payDate = f.payDate;
342 bool alwaysAddIfPaysOnSettlement = f.alwaysAddIfPaysOnSettlement;
343 bool indexInterpolated = f.indexInterpolated;
344 Frequency indexFrequency = f.indexFreq;
345 Period indexAvailabilityLag = f.availabilityLeg;
347 SimpleCashFlow dummyCf(0.0, payDate);
348 if (!dummyCf.hasOccurred(d) || (alwaysAddIfPaysOnSettlement && dummyCf.date() == d)) {
350 needsForecast(
fixingDate, d, indexInterpolated, indexFrequency, indexAvailabilityLag, f.mandatory);
351 if (!fixingDates.empty())
352 result[indexName].addDates(fixingDates);
354 for (
const auto& [d, mandatory] : fixingDates) {
355 Date previousYear = d - 1 * Years;
356 result[indexName].addDate(previousYear, mandatory);
365 const QuantLib::Date& payDate,
const bool alwaysAddIfPaysOnSettlement,
366 const bool mandatory) {
368 {indexName,
fixingDate, payDate, payDate == Date::maxDate() || alwaysAddIfPaysOnSettlement, mandatory});
374 const std::string& indexName,
const QuantLib::Date& payDate,
375 const bool alwaysAddIfPaysOnSettlement) {
376 for (
auto const& [date, mandatory] : fixingDates) {
377 fixingDates_.insert({indexName, date, payDate, alwaysAddIfPaysOnSettlement, mandatory});
382 const QuantLib::Date& payDate,
const bool alwaysAddIfPaysOnSettlement,
383 const bool mandatory) {
384 for (
auto const& date : fixingDates) {
385 fixingDates_.insert({indexName, date, payDate, alwaysAddIfPaysOnSettlement, mandatory});
390 const bool indexInterpolated,
const Frequency indexFrequency,
391 const Period& indexAvailabilityLag,
392 const CPI::InterpolationType couponInterpolation,
393 const Frequency couponFrequency,
const QuantLib::Date& payDate,
394 const bool alwaysAddIfPaysOnSettlement,
const bool mandatory) {
414 const bool indexInterpolated,
const Frequency indexFrequency,
415 const Period& indexAvailabilityLag,
const QuantLib::Date& payDate,
416 const bool alwaysAddIfPaysOnSettlement,
const bool mandatory) {
440 out << indexName <<
" " << QuantLib::io::iso_date(
fixingDate) <<
" " << QuantLib::io::iso_date(payDate) <<
" "
441 << std::boolalpha << alwaysAddIfPaysOnSettlement <<
" " << std::boolalpha << mandatory <<
"\n";
445std::ostream&
operator<<(std::ostream& out,
const std::set<ore::data::RequiredFixings::FixingEntry>& entries) {
446 for (
auto const& f : entries) {
452std::ostream&
operator<<(std::ostream& out,
const std::set<ore::data::RequiredFixings::InflationFixingEntry>& entries) {
453 for (
auto const& f : entries) {
460 const std::set<ore::data::RequiredFixings::ZeroInflationFixingEntry>& entries) {
461 for (
auto const& f : entries) {
468 out <<
"IndexName FixingDate PayDate AlwaysAddIfPaysOnSettlement\n";
486 if (
auto bma = QuantLib::ext::dynamic_pointer_cast<QuantExt::BMAIndexWrapper>(c.index())) {
493 IndexNameTranslator::instance().oreName(c.index()->name()), c.date(),
true);
495 auto fallback = QuantLib::ext::dynamic_pointer_cast<FallbackIborIndex>(c.index());
496 if (fallback !=
nullptr && c.fixingDate() >= fallback->switchDate()) {
498 IndexNameTranslator::instance().oreName(fallback->rfrIndex()->name()),
508 c.underlying()->accept(*
this);
512 if (CPICashFlow* cc =
dynamic_cast<CPICashFlow*
>(&c)) {
519 auto zeroInflationIndex = QuantLib::ext::dynamic_pointer_cast<ZeroInflationIndex>(c.index());
520 QL_REQUIRE(zeroInflationIndex,
"Expected CPICashFlow to have an index of type ZeroInflationIndex");
522 QL_DEPRECATED_DISABLE_WARNING
523 bool isInterpolated = c.interpolation() == QuantLib::CPI::Linear ||
524 (c.interpolation() == QuantLib::CPI::AsIndex && zeroInflationIndex->interpolated());
525 QL_DEPRECATED_ENABLE_WARNING
528 c.baseDate(), IndexNameTranslator::instance().oreName(c.index()->name()), isInterpolated,
529 zeroInflationIndex->frequency(), zeroInflationIndex->availabilityLag(), c.interpolation(), c.frequency(),
533 c.fixingDate(), IndexNameTranslator::instance().oreName(c.index()->name()), isInterpolated,
534 zeroInflationIndex->frequency(), zeroInflationIndex->availabilityLag(), c.interpolation(), c.frequency(),
540 QL_DEPRECATED_DISABLE_WARNING
541 bool isInterpolated = c.observationInterpolation() == QuantLib::CPI::Linear ||
542 (c.observationInterpolation() == QuantLib::CPI::AsIndex && c.cpiIndex()->interpolated());
543 QL_DEPRECATED_ENABLE_WARNING
546 c.baseDate(), IndexNameTranslator::instance().oreName(c.cpiIndex()->name()), isInterpolated,
547 c.cpiIndex()->frequency(), c.cpiIndex()->availabilityLag(), c.observationInterpolation(),
548 c.cpiIndex()->frequency(), c.date());
551 c.fixingDate(), IndexNameTranslator::instance().oreName(c.cpiIndex()->name()), isInterpolated,
552 c.cpiIndex()->frequency(), c.cpiIndex()->availabilityLag(), c.observationInterpolation(),
553 c.cpiIndex()->frequency(), c.date());
558 c.fixingDate(), IndexNameTranslator::instance().oreName(c.yoyIndex()->name()), c.yoyIndex()->interpolated(),
559 c.yoyIndex()->frequency(), c.yoyIndex()->availabilityLag(), c.date());
568 auto fallback = QuantLib::ext::dynamic_pointer_cast<FallbackOvernightIndex>(c.index());
570 if (fallback && c.
fixingDate() >= fallback->switchDate())
571 indexName = fallback->rfrIndex()->name();
573 indexName = c.index()->name();
589 IndexNameTranslator::instance().oreName(c.swapSpreadIndex()->swapIndex1()->name()),
592 IndexNameTranslator::instance().oreName(c.swapSpreadIndex()->swapIndex2()->name()),
612 IndexNameTranslator::instance().oreName(c.
fxIndex()->name()), c.date());
644 QL_REQUIRE(c.
underlying(),
"FixingDateGetter::visit(IndexedCoupon): underlying() is null");
653 QL_REQUIRE(c.
underlying(),
"FixingDateGetter::visit(IndexWrappedCashFlow): underlying() is null");
678 IndexNameTranslator::instance().oreName(c.
fxIndex()->name()), c.date());
683 for (
const auto& [pricingDate, index] : indices) {
685 bool isTodaysFixing = Settings::instance().evaluationDate() == pricingDate;
686 if (
auto powerIndex = QuantLib::ext::dynamic_pointer_cast<OffPeakPowerIndex>(index)) {
690 bool isOffPeakDay = powerIndex->peakCalendar().isHoliday(pricingDate);
692 isOffPeakDay && !isTodaysFixing);
694 if (
auto d = index->expiryDate(); d != Date() && d < pricingDate) {
697 isOffPeakDay && !isTodaysFixing);
702 if (
auto d = index->expiryDate(); d != Date() && d < pricingDate) {
706 if (
auto baseFutureIndex = QuantLib::ext::dynamic_pointer_cast<CommodityBasisFutureIndex>(index)) {
709 baseFutureIndex->baseCashflow(c.date())->accept(baseCashflowGetter);
723 IndexNameTranslator::instance().oreName(bc.
fxIndex()->name()), bc.
date());
725 IndexNameTranslator::instance().oreName(bc.
fxIndex()->name()), bc.
date());
730 vector<QuantLib::ext::shared_ptr<Index>> indexes;
731 vector<QuantLib::ext::shared_ptr<FxIndex>> fxIndexes;
733 if (
auto e = QuantLib::ext::dynamic_pointer_cast<QuantExt::CompositeIndex>(bc.
index())) {
734 indexes = e->indices();
735 fxIndexes = e->fxConversion();
738 std::vector<std::pair<QuantLib::Date, std::string>> fixings =
741 for (
const auto& f : fixings)
744 indexes.push_back(bc.
index());
749 fxIndexes.push_back(bc.
fxIndex());
753 for (
const auto& ind : indexes) {
755 auto startDate = ind->fixingCalendar().adjust(bc.
fixingStartDate(), Preceding);
756 auto endDate = ind->fixingCalendar().adjust(bc.
fixingEndDate(), Preceding);
758 auto gi = QuantLib::ext::dynamic_pointer_cast<QuantExt::GenericIndex>(ind);
760 if (!gi || gi->expiry() == Date() || startDate < gi->expiry()) {
766 if (!gi || gi->expiry() == Date() || endDate < gi->expiry())
772 for (
const auto& fx : fxIndexes) {
775 IndexNameTranslator::instance().oreName(fx->name()), bc.
date());
777 IndexNameTranslator::instance().oreName(fx->name()), bc.
date());
782 IndexNameTranslator::instance().oreName(fx->name()), bc.
date(),
false);
784 IndexNameTranslator::instance().oreName(fx->name()), bc.
date(),
false);
789void addToRequiredFixings(
const QuantLib::Leg& leg,
const QuantLib::ext::shared_ptr<FixingDateGetter>& fixingDateGetter) {
790 for (
auto const& c : leg) {
791 QL_REQUIRE(c,
"addToRequiredFixings(), got null cashflow, this is unexpected");
792 c->accept(*fixingDateGetter);
798 for (
auto& [indexName, fixingDates] : fixings) {
803 Frequency f = infIndex->frequency();
804 for (
const auto& [d, mandatory] : fixingDates) {
805 auto period = inflationPeriod(d, f);
806 if (d == period.first) {
808 amendedFixingDates.
addDate(period.second, mandatory);
811 amendedFixingDates.
addDate(d, mandatory);
815 fixings[indexName] = amendedFixingDates;
821 const Period& iborLookback,
const Period& oisLookback,
const Period& bmaLookback,
822 const Period& inflationLookback) {
824 for (
auto const& [configuration, _] : mktParams.
configurations()) {
826 LOG(
"Start adding market fixing dates for configuration '" << configuration <<
"'");
828 QuantLib::ext::shared_ptr<Conventions> conventions = InstrumentConventions::instance().conventions();
834 QL_REQUIRE(iborLookback >= 0 * Days,
"Ibor lookback period must be non-negative");
836 DLOG(
"Start adding market fixing dates for interest rate indices.");
843 std::set<std::string> indices;
848 QuantLib::ext::shared_ptr<IborIndex> dummy;
854 QuantLib::ext::shared_ptr<IborIndex> dummy;
856 indices.insert(spec->curveConfigID());
860 for (
const auto& i : indices) {
862 if (oisDates.empty()) {
863 TLOG(
"Generating fixing dates for overnight indices.");
864 oisDates = generateLookbackDates(asof, oisLookback,
calendar);
866 TLOG(
"Adding extra fixing dates for overnight index " << i);
867 fixings[i].addDates(oisDates,
false);
870 if (bmaDates.empty()) {
871 TLOG(
"Generating fixing dates for bma/sifma indices.");
872 bmaDates = generateLookbackDates(asof, bmaLookback,
calendar);
874 fixings[i].addDates(bmaDates,
false);
875 if (iborDates.empty()) {
876 TLOG(
"Generating fixing dates for ibor indices.");
877 iborDates = generateLookbackDates(asof, iborLookback,
calendar);
879 std::set<string> liborNames;
881 auto bma = QuantLib::ext::dynamic_pointer_cast<BMABasisSwapConvention>(c);
883 bma,
"internal error, could not cast to BMABasisSwapConvention in addMarketFixingDates()");
884 if (bma->bmaIndexName() == i) {
885 liborNames.insert(bma->liborIndexName());
888 for (
auto const& l : liborNames) {
889 TLOG(
"Adding extra fixing dates for libor index " << l <<
" from bma/sifma index " << i);
890 fixings[l].addDates(iborDates,
false);
893 if (iborDates.empty()) {
894 TLOG(
"Generating fixing dates for ibor indices.");
895 iborDates = generateLookbackDates(asof, iborLookback,
calendar);
897 TLOG(
"Adding extra fixing dates for ibor index " << i);
898 fixings[i].addDates(iborDates,
false);
902 DLOG(
"Finished adding market fixing dates for interest rate indices.");
909 QL_REQUIRE(inflationLookback >= 0 * Days,
"Inflation lookback period must be non-negative");
912 Date lookback = NullCalendar().advance(asof, -inflationLookback);
913 lookback = Date(1, lookback.month(), lookback.year());
916 TLOG(
"Adding date " << io::iso_date(lookback) <<
" to fixings for inflation indices");
917 dates.insert(lookback);
918 lookback = NullCalendar().advance(lookback, 1 * Months);
919 }
while (lookback <= asof);
924 TLOG(
"Adding extra fixing dates for (zero) inflation index " << kv.first);
925 fixings[kv.first].addDates(dates,
false);
931 TLOG(
"Adding extra fixing dates for (yoy) inflation index " << kv.first);
932 fixings[kv.first].addDates(dates,
false);
942 Period commodityLookback = 2 * Months;
943 Date lookback = asof - commodityLookback;
944 lookback = Date(1, lookback.month(), lookback.year());
947 TLOG(
"Adding date " << io::iso_date(lookback) <<
" to fixings for commodities");
948 dates.insert(lookback++);
949 }
while (lookback <= asof);
954 Size numberMonths = 2;
955 vector<Date> contractExpiries;
956 Date startContract = asof - numberMonths * Months;
957 Date endContract = asof + numberMonths * Months;
959 Month m = startContract.month();
960 Year y = startContract.year();
961 TLOG(
"Adding contract month and year (" << m <<
"," << y <<
")");
962 contractExpiries.push_back(Date(1, m, y));
963 startContract += 1 * Months;
964 }
while (startContract <= endContract);
970 QuantLib::ext::shared_ptr<CommodityFutureConvention> cfc;
971 if (conventions->has(kv.first)) {
972 cfc = QuantLib::ext::dynamic_pointer_cast<CommodityFutureConvention>(conventions->get(kv.first));
977 if (
auto oppIdx = QuantLib::ext::dynamic_pointer_cast<OffPeakPowerIndex>(commIdx)) {
978 DLOG(
"Commodity " << kv.first <<
" is off-peak power so adding underlying daily contracts.");
979 const auto& opIndex = oppIdx->offPeakIndex();
980 const auto& pIndex = oppIdx->peakIndex();
981 for (
const Date& expiry : dates) {
982 auto tmpIdx = oppIdx->clone(expiry);
983 auto opName = opIndex->clone(expiry)->name();
984 TLOG(
"Adding (date, id) = (" << io::iso_date(expiry) <<
"," << opName <<
")");
985 fixings[opName].addDate(expiry,
false);
986 auto pName = pIndex->clone(expiry)->name();
987 TLOG(
"Adding (date, id) = (" << io::iso_date(expiry) <<
"," << pName <<
")");
988 fixings[pName].addDate(expiry,
false);
990 }
else if (cfc->contractFrequency() == Daily) {
991 DLOG(
"Commodity " << kv.first <<
" has daily frequency so adding daily contracts.");
992 for (
const Date& expiry : dates) {
993 auto indexName = commIdx->clone(expiry)->name();
994 TLOG(
"Adding (date, id) = (" << io::iso_date(expiry) <<
"," << indexName <<
")");
995 fixings[indexName].addDate(expiry,
false);
998 DLOG(
"Commodity " << kv.first <<
" is not daily so adding the monthly contracts.");
999 for (
const Date& expiry : contractExpiries) {
1000 auto indexName = commIdx->clone(expiry)->name();
1001 TLOG(
"Adding extra fixing dates for commodity future " << indexName);
1002 fixings[indexName].addDates(dates,
false);
1007 DLOG(
"Commodity " << kv.first <<
" does not have future conventions so adding daily fixings.");
1008 auto indexName = commIdx->name();
1009 TLOG(
"Adding extra fixing dates for commodity spot " << indexName);
1010 fixings[indexName].addDates(dates,
false);
1015 LOG(
"Finished adding market fixing dates for configuration '" << configuration <<
"'");
Date date() const override
const boost::shared_ptr< FxIndex > & fxIndex() const
const std::vector< Date > & fxFixingDates() const
const std::vector< Date > & fixingDates() const
ext::shared_ptr< AverageBMACoupon > underlying() const
ext::shared_ptr< AverageONIndexedCoupon > underlying() const
ext::shared_ptr< OvernightIndexedCoupon > underlying() const
const ext::shared_ptr< ConstantMaturityBondIndex > & bondIndex() const
virtual const std::vector< std::pair< QuantLib::Date, ext::shared_ptr< CommodityIndex > > > & indices() const=0
const boost::shared_ptr< FxIndex > & fxIndex() const
std::vector< Date > fixingDates() const
Date fixingEndDate() const
const boost::shared_ptr< QuantExt::EquityIndex2 > & equityCurve() const
Date fixingStartDate() const
const boost::shared_ptr< FxIndex > & fxIndex() const
std::vector< Date > fixingDates() const
const boost::shared_ptr< QuantExt::EquityIndex2 > & equityCurve() const
Date fixingStartDate() const
Date date() const override
const boost::shared_ptr< FxIndex > & fxIndex() const
Date fxFixingDate() const
boost::shared_ptr< FloatingRateCoupon > underlying() const
boost::shared_ptr< Index > index() const
boost::shared_ptr< CashFlow > underlying() const
Date date() const override
const Date & fixingDate() const
boost::shared_ptr< Coupon > underlying() const
boost::shared_ptr< Index > index() const
const Date & fixingDate() const
virtual Date fixingDateNumerator() const
bool isInterpolated() const
virtual ext::shared_ptr< ZeroInflationIndex > cpiIndex() const
virtual Date fixingDateDenumerator() const
const std::vector< Date > & fixingDates() const
Date fixingDate() const override
const std::vector< Date > & fixingDates() const
const boost::shared_ptr< FxIndex > & fxIndex() const
const boost::shared_ptr< Index > & index() const
const Real initialPrice() const
const Date & fixingEndDate() const
Date date() const override
const Date & fixingStartDate() const
RequiredFixings & requiredFixings_
bool requireFixingStartDates_
void visit(QuantLib::CashFlow &c) override
QuantLib::ext::shared_ptr< QuantExt::FxIndex > additionalFxIndex_
void addDate(const QuantLib::Date &date, const bool mandatory)
void addFixingDates(const std::vector< std::pair< QuantLib::Date, bool > > &fixingDates, const std::string &indexName, const QuantLib::Date &payDate=Date::maxDate(), const bool alwaysAddIfPaysOnSettlement=false)
std::set< ZeroInflationFixingEntry > zeroInflationFixingDates_
std::set< InflationFixingEntry > yoyInflationFixingDates_
void addData(const RequiredFixings &requiredFixings)
std::map< std::string, FixingDates > fixingDatesIndices(const QuantLib::Date &settlementDate=QuantLib::Date()) const
void addZeroInflationFixingDate(const QuantLib::Date &fixingDate, const std::string &indexName, const bool indexInterpolated, const Frequency indexFrequency, const Period &indexAvailabilityLag, const CPI::InterpolationType coupopnInterpolation, const Frequency couponFrequency, const QuantLib::Date &payDate=Date::maxDate(), const bool alwaysAddIfPaysOnSettlement=false, const bool mandatoryFixing=true)
RequiredFixings filteredFixingDates(const QuantLib::Date &settlementDate=QuantLib::Date())
void addFixingDate(const QuantLib::Date &fixingDate, const std::string &indexName, const QuantLib::Date &payDate=Date::maxDate(), const bool alwaysAddIfPaysOnSettlement=false, const bool mandatoryFixing=true)
std::set< FixingEntry > fixingDates_
void addYoYInflationFixingDate(const QuantLib::Date &fixingDate, const std::string &indexName, const bool indexInterpolated, const Frequency indexFrequency, const Period &indexAvailabilityLag, const QuantLib::Date &payDate=Date::maxDate(), const bool alwaysAddIfPaysOnSettlement=false, const bool mandatoryFixing=true)
RequiredFixings makeCopyWithMandatoryOverride(bool mandatory)
Today's Market Parameters.
const vector< pair< string, MarketConfiguration > > & configurations() const
const map< string, string > & mapping(const MarketObject o, const string &configuration) const
EUR => Yield/EUR/EUR6M, USD => Yield/USD/USD3M etc.
bool hasMarketObject(const MarketObject &o) const
Logic for calculating required fixing dates on legs.
QuantLib::ext::shared_ptr< CurveSpec > parseCurveSpec(const string &s)
function to convert a string into a curve spec
bool isOvernightIndex(const string &indexName)
Return true if the indexName is that of an overnight index, otherwise false.
bool isBmaIndex(const string &indexName)
Return true if the indexName is that of an bma/sifma index, otherwise false.
pair< bool, QuantLib::ext::shared_ptr< ZeroInflationIndex > > isInflationIndex(const string &indexName)
bool tryParseIborIndex(const string &s, QuantLib::ext::shared_ptr< IborIndex > &index)
Try to convert std::string to QuantLib::IborIndex.
ibor fallback configuration
translates between QuantLib::Index::name() and ORE names
Map text representations to QuantLib/QuantExt types.
#define LOG(text)
Logging Macro (Level = Notice)
#define DLOG(text)
Logging Macro (Level = Debug)
#define TLOG(text)
Logging Macro (Level = Data)
QuantLib::Date fixingDate(const QuantLib::Date &d, const QuantLib::Period obsLag, const QuantLib::Frequency freq, bool interpolated)
bool operator<(const Dividend &d1, const Dividend &d2)
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
void amendInflationFixingDates(std::map< std::string, RequiredFixings::FixingDates > &fixings)
void addMarketFixingDates(const Date &asof, map< string, RequiredFixings::FixingDates > &fixings, const TodaysMarketParameters &mktParams, const Period &iborLookback, const Period &oisLookback, const Period &bmaLookback, const Period &inflationLookback)
void addToRequiredFixings(const QuantLib::Leg &leg, const QuantLib::ext::shared_ptr< FixingDateGetter > &fixingDateGetter)
QuantLib::ext::shared_ptr< QuantExt::CommodityIndex > parseCommodityIndex(const string &name, bool hasPrefix, const Handle< PriceTermStructure > &ts, const Calendar &cal, const bool enforceFutureIndex)
Serializable Credit Default Swap.
QuantLib::Date fixingDate
bool alwaysAddIfPaysOnSettlement
friend bool operator<(const InflationFixingEntry &lhs, const InflationFixingEntry &rhs)
QuantLib::Period availabilityLeg
QuantLib::Frequency indexFreq
QuantLib::Frequency couponFrequency
CPI::InterpolationType couponInterpolation