28#include <ql/patterns/visitor.hpp>
29#include <ql/time/date.hpp>
40class CappedFlooredCoupon;
44class YoYInflationCoupon;
45class OvernightIndexedCoupon;
46class AverageBMACoupon;
49class StrippedCappedFlooredCoupon;
53class CappedFlooredAverageBMACoupon;
54class AverageONIndexedCoupon;
55class OvernightIndexedCoupon;
57class CappedFlooredAverageONIndexedCoupon;
58class CappedFlooredOvernightIndexedCoupon;
60class FloatingRateFXLinkedNotionalCoupon;
61class FXLinkedCashFlow;
62class AverageFXLinkedCashFlow;
63class SubPeriodsCoupon1;
65class IndexWrappedCashFlow;
66class NonStandardYoYInflationCoupon;
69class CommodityIndexedAverageCashFlow;
70class CommodityIndexedCashFlow;
71class EquityMarginCoupon;
78class FixingDateGetter;
87 FixingDates(
const std::set<QuantLib::Date>& dates,
const bool mandatory) {
addDates(dates, mandatory); }
93 void addDate(
const QuantLib::Date& date,
const bool mandatory) {
94 auto exits =
data_.find(date);
95 if (exits ==
data_.end() || exits->second ==
false) {
96 data_[date] = mandatory;
101 for (
const auto& [d, man] : dates) {
107 for (
const auto& [d, _] : dates) {
112 void addDates(
const std::set<QuantLib::Date>& dates,
bool mandatory) {
113 for (
const QuantLib::Date& d : dates) {
119 std::map<QuantLib::Date, bool> results;
120 for (
const auto& [d, mandatory] :
data_) {
122 results.insert({d,mandatory});
129 std::map<QuantLib::Date, bool>::const_iterator
begin()
const {
return data_.begin();}
130 std::map<QuantLib::Date, bool>::const_iterator
end()
const {
return data_.end();}
137 std::map<QuantLib::Date, bool>
data_;
175 std::map<std::string, FixingDates>
184 void addFixingDate(
const QuantLib::Date& fixingDate,
const std::string& indexName,
185 const QuantLib::Date& payDate = Date::maxDate(),
const bool alwaysAddIfPaysOnSettlement =
false,
186 const bool mandatoryFixing =
true);
192 void addFixingDates(
const std::vector<std::pair<QuantLib::Date, bool>>& fixingDates,
const std::string& indexName,
193 const QuantLib::Date& payDate = Date::maxDate(),
194 const bool alwaysAddIfPaysOnSettlement =
false);
198 void addFixingDates(
const std::vector<QuantLib::Date>& fixingDates,
const std::string& indexName,
199 const QuantLib::Date& payDate = Date::maxDate(),
const bool alwaysAddIfPaysOnSettlement =
false,
200 const bool mandatory =
true);
205 const bool indexInterpolated,
const Frequency indexFrequency,
206 const Period& indexAvailabilityLag,
207 const CPI::InterpolationType coupopnInterpolation,
const Frequency couponFrequency,
208 const QuantLib::Date& payDate = Date::maxDate(),
209 const bool alwaysAddIfPaysOnSettlement =
false,
210 const bool mandatoryFixing =
true);
216 const bool indexInterpolated,
const Frequency indexFrequency,
217 const Period& indexAvailabilityLag,
const QuantLib::Date& payDate = Date::maxDate(),
218 const bool alwaysAddIfPaysOnSettlement =
false,
219 const bool mandatoryFixing =
true);
261 public QuantLib::Visitor<QuantLib::CashFlow>,
262 public QuantLib::Visitor<QuantLib::FloatingRateCoupon>,
263 public QuantLib::Visitor<QuantLib::IborCoupon>,
264 public QuantLib::Visitor<QuantLib::CappedFlooredCoupon>,
265 public QuantLib::Visitor<QuantLib::IndexedCashFlow>,
266 public QuantLib::Visitor<QuantLib::CPICashFlow>,
267 public QuantLib::Visitor<QuantLib::CPICoupon>,
268 public QuantLib::Visitor<QuantLib::YoYInflationCoupon>,
269 public QuantLib::Visitor<QuantLib::OvernightIndexedCoupon>,
270 public QuantLib::Visitor<QuantExt::OvernightIndexedCoupon>,
271 public QuantLib::Visitor<QuantExt::CappedFlooredOvernightIndexedCoupon>,
272 public QuantLib::Visitor<QuantLib::AverageBMACoupon>,
273 public QuantLib::Visitor<QuantExt::CappedFlooredAverageBMACoupon>,
274 public QuantLib::Visitor<QuantLib::CmsSpreadCoupon>,
275 public QuantLib::Visitor<QuantLib::DigitalCoupon>,
276 public QuantLib::Visitor<QuantLib::StrippedCappedFlooredCoupon>,
277 public QuantLib::Visitor<QuantExt::AverageONIndexedCoupon>,
278 public QuantLib::Visitor<QuantExt::CappedFlooredAverageONIndexedCoupon>,
279 public QuantLib::Visitor<QuantExt::EquityCoupon>,
280 public QuantLib::Visitor<QuantExt::FloatingRateFXLinkedNotionalCoupon>,
281 public QuantLib::Visitor<QuantExt::FXLinkedCashFlow>,
282 public QuantLib::Visitor<QuantExt::AverageFXLinkedCashFlow>,
283 public QuantLib::Visitor<QuantExt::SubPeriodsCoupon1>,
284 public QuantLib::Visitor<QuantExt::IndexedCoupon>,
285 public QuantLib::Visitor<QuantExt::IndexWrappedCashFlow>,
286 public QuantLib::Visitor<QuantExt::NonStandardYoYInflationCoupon>,
287 public QuantLib::Visitor<QuantExt::CmbCoupon>,
288 public QuantLib::Visitor<QuantExt::EquityMarginCoupon>,
289 public QuantLib::Visitor<QuantExt::CommodityCashFlow>,
290 public QuantLib::Visitor<QuantExt::BondTRSCashFlow>,
291 public QuantLib::Visitor<QuantExt::TRSCashFlow> {
299 void visit(QuantLib::CashFlow& c)
override;
300 void visit(QuantLib::FloatingRateCoupon& c)
override;
301 void visit(QuantLib::IborCoupon& c)
override;
302 void visit(QuantLib::CappedFlooredCoupon& c)
override;
303 void visit(QuantLib::IndexedCashFlow& c)
override;
307 void visit(QuantLib::CPICashFlow& c)
override;
308 void visit(QuantLib::CPICoupon& c)
override;
309 void visit(QuantLib::YoYInflationCoupon& c)
override;
311 void visit(QuantLib::OvernightIndexedCoupon& c)
override;
314 void visit(QuantLib::AverageBMACoupon& c)
override;
316 void visit(QuantLib::CmsSpreadCoupon& c)
override;
317 void visit(QuantLib::DigitalCoupon& c)
override;
318 void visit(QuantLib::StrippedCappedFlooredCoupon& c)
override;
350void addToRequiredFixings(
const QuantLib::Leg& leg,
const QuantLib::ext::shared_ptr<FixingDateGetter>& fixingDateGetter);
384void addMarketFixingDates(
const QuantLib::Date& asof, std::map<std::string, RequiredFixings::FixingDates>& fixings,
386 const QuantLib::Period& iborLookback = 5 * QuantLib::Days,
387 const QuantLib::Period& oisLookback = 4 * QuantLib::Months,
388 const QuantLib::Period& bmaLookback = 2 * QuantLib::Weeks,
389 const QuantLib::Period& inflationLookback = 1 * QuantLib::Years);
void setRequireFixingStartDates(const bool b)
void visit(QuantLib::CmsSpreadCoupon &c) override
RequiredFixings & requiredFixings_
void visit(QuantLib::CPICoupon &c) override
bool requireFixingStartDates_
void visit(QuantLib::CPICashFlow &c) override
std::string oreIndexName(const std::string &qlIndexName) const
void setAdditionalFxIndex(const QuantLib::ext::shared_ptr< QuantExt::FxIndex > &i)
void visit(QuantLib::IborCoupon &c) override
void visit(QuantLib::DigitalCoupon &c) override
void visit(QuantLib::CappedFlooredCoupon &c) override
FixingDateGetter(RequiredFixings &requiredFixings)
Constructor.
void visit(QuantLib::YoYInflationCoupon &c) override
void visit(QuantLib::StrippedCappedFlooredCoupon &c) override
void visit(QuantLib::CashFlow &c) override
void visit(QuantLib::AverageBMACoupon &c) override
void visit(QuantLib::IndexedCashFlow &c) override
void visit(QuantLib::FloatingRateCoupon &c) override
QuantLib::ext::shared_ptr< QuantExt::FxIndex > additionalFxIndex_
std::map< QuantLib::Date, bool >::const_iterator end() const
FixingDates(const std::set< QuantLib::Date > &dates, const bool mandatory)
std::map< QuantLib::Date, bool > data_
void addDates(const FixingDates &dates)
void addDate(const QuantLib::Date &date, const bool mandatory)
FixingDates(const std::map< QuantLib::Date, bool > &dates)
void addDates(const FixingDates &dates, bool mandatory)
std::map< QuantLib::Date, bool >::const_iterator begin() const
Iterrator for range-base forloop.
FixingDates filterByDate(const QuantLib::Date &before) const
void addDates(const std::set< QuantLib::Date > &dates, 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())
friend std::ostream & operator<<(std::ostream &, const RequiredFixings &)
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.
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)
Serializable Credit Default Swap.
QuantLib::Date fixingDate
bool alwaysAddIfPaysOnSettlement
friend bool operator<(const FixingEntry &lhs, const FixingEntry &rhs)
friend bool operator<(const InflationFixingEntry &lhs, const InflationFixingEntry &rhs)
QuantLib::Period availabilityLeg
QuantLib::Frequency indexFreq
QuantLib::Frequency couponFrequency
CPI::InterpolationType couponInterpolation
friend bool operator<(const ZeroInflationFixingEntry &lhs, const ZeroInflationFixingEntry &rhs)
A class to hold todays market configuration(s)