26#include <boost/make_shared.hpp>
36#include <ql/cashflow.hpp>
37#include <ql/experimental/coupons/swapspreadindex.hpp>
38#include <ql/indexes/iborindex.hpp>
39#include <ql/position.hpp>
55class ReferenceDataManager;
185 const vector<string>&
spreadDates = vector<string>(),
const vector<double>&
caps = vector<double>(),
186 const vector<string>&
capDates = vector<string>(),
const vector<double>&
floors = vector<double>(),
187 const vector<string>&
floorDates = vector<string>(),
188 const vector<double>&
gearings = vector<double>(),
287 const vector<double>&
rates,
const vector<string>&
rateDates = std::vector<string>(),
289 const vector<string>&
capDates = vector<string>(),
const vector<double>&
floors = vector<double>(),
355 const vector<double>&
gearings = std::vector<double>(),
356 const vector<string>&
gearingDates = std::vector<string>(),
357 const vector<double>&
spreads = std::vector<double>(),
358 const vector<string>&
spreadDates = std::vector<string>(),
const vector<double>&
caps = vector<double>(),
359 const vector<string>&
capDates = vector<string>(),
const vector<double>&
floors = vector<double>(),
420 const vector<string>&
spreadDates = vector<string>(),
const vector<double>&
caps = vector<double>(),
421 const vector<string>&
capDates = vector<string>(),
const vector<double>&
floors = vector<double>(),
422 const vector<string>&
floorDates = vector<string>(),
const vector<double>&
gearings = vector<double>(),
487 const vector<double>
callPayoffs = vector<double>(),
490 const vector<double>
putStrikes = vector<double>(),
492 const vector<double>
putPayoffs = vector<double>(),
556 const vector<double>&
caps = vector<double>(),
const vector<string>&
capDates = vector<string>(),
557 const vector<double>&
floors = vector<double>(),
558 const vector<string>&
floorDates = vector<string>(),
559 const vector<double>&
gearings = vector<double>(),
626 const QuantLib::ext::shared_ptr<CMSSpreadLegData>&
underlying, Position::Type
callPosition = Position::Long,
693 const vector<string>&
spreadDates = vector<string>(),
const vector<double>&
caps = vector<double>(),
694 const vector<string>&
capDates = vector<string>(),
const vector<double>&
floors = vector<double>(),
695 const vector<string>&
floorDates = vector<string>(),
const vector<double>&
gearings = vector<double>(),
850 LegData(
const QuantLib::ext::shared_ptr<LegAdditionalData>& innerLegData,
bool isPayer,
const string&
currency,
852 const std::vector<double>&
notionals = std::vector<double>(),
857 const std::vector<AmortizationData>&
amortizationData = std::vector<AmortizationData>(),
860 const std::vector<std::string>&
paymentDates = std::vector<std::string>(),
958Leg
makeFixedLeg(
const LegData& data,
const QuantLib::Date& openEndDateReplacement = Null<Date>());
960Leg
makeIborLeg(
const LegData& data,
const QuantLib::ext::shared_ptr<IborIndex>& index,
961 const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
const bool attachPricer =
true,
962 const QuantLib::Date& openEndDateReplacement = Null<Date>());
963Leg
makeOISLeg(
const LegData& data,
const QuantLib::ext::shared_ptr<OvernightIndex>& index,
964 const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
const bool attachPricer =
true,
965 const QuantLib::Date& openEndDateReplacement = Null<Date>());
966Leg
makeBMALeg(
const LegData& data,
const QuantLib::ext::shared_ptr<QuantExt::BMAIndexWrapper>& indexWrapper,
967 const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
968 const QuantLib::Date& openEndDateReplacement = Null<Date>());
970Leg
makeNotionalLeg(
const Leg& refLeg,
const bool initNomFlow,
const bool finalNomFlow,
const bool amortNomFlow,
971 const QuantLib::Natural notionalPaymentLag,
const BusinessDayConvention paymentConvention,
972 const Calendar paymentCalendar,
const bool excludeIndexing =
true);
973Leg
makeCPILeg(
const LegData& data,
const QuantLib::ext::shared_ptr<ZeroInflationIndex>& index,
974 const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
975 const QuantLib::Date& openEndDateReplacement = Null<Date>());
976Leg
makeYoYLeg(
const LegData& data,
const QuantLib::ext::shared_ptr<InflationIndex>& index,
977 const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
978 const QuantLib::Date& openEndDateReplacement = Null<Date>());
979Leg
makeCMSLeg(
const LegData& data,
const QuantLib::ext::shared_ptr<QuantLib::SwapIndex>& swapindex,
980 const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
const bool attachPricer =
true,
981 const QuantLib::Date& openEndDateReplacement = Null<Date>());
983 const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
const bool attachPricer =
true,
984 const QuantLib::Date& openEndDateReplacement = Null<Date>());
986 const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
const bool attachPricer =
true,
987 const QuantLib::Date& openEndDateReplacement = Null<Date>());
988Leg
makeCMSSpreadLeg(
const LegData& data,
const QuantLib::ext::shared_ptr<QuantLib::SwapSpreadIndex>& swapSpreadIndex,
989 const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
const bool attachPricer =
true,
990 const QuantLib::Date& openEndDateReplacement = Null<Date>());
992 const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
993 const QuantLib::Date& openEndDateReplacement = Null<Date>());
995 const QuantLib::ext::shared_ptr<QuantExt::FxIndex>& fxIndex =
nullptr,
996 const QuantLib::Date& openEndDateReplacement = Null<Date>());
1002std::pair<std::string, SimmCreditQualifierMapping>
1004 const std::string& tradeId,
const std::string& tradeType);
1011template <
typename T>
1012vector<T>
buildScheduledVector(
const vector<T>& values,
const vector<string>& dates,
const Schedule& schedule,
1013 const bool checkAllValuesAppearInResult =
false);
1016template <
typename T>
1017vector<T>
normaliseToSchedule(
const vector<T>& values,
const Schedule& schedule,
const T& defaultValue);
1020template <
typename T>
1022 const T& defaultValue,
const bool checkAllValuesAppearInResult =
false);
1026template <
typename T>
1028 const vector<T>& inputValues);
1036 const Schedule& schedule,
1041 const Schedule& schedule,
1047 const DayCounter& dc);
1051 const bool annuityAllowed =
false,
const std::vector<Real>& rates = std::vector<Real>());
1054void applyIndexing(Leg& leg,
const LegData& data,
const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
1055 RequiredFixings& requiredFixings,
const QuantLib::Date& openEndDateReplacement = Null<Date>(),
1056 const bool useXbsCurves =
false);
1060template <
typename T>
1062 const bool checkAllValuesAppearInResult) {
1063 if (values.size() < 2 || dates.size() == 0)
1066 QL_REQUIRE(values.size() == dates.size(),
"Value / Date size mismatch in buildScheduledVector."
1067 <<
"Value:" << values.size() <<
", Dates:" << dates.size());
1070 std::vector<QuantLib::Date> parsedDates;
1071 std::transform(dates.begin(), dates.end(), std::back_inserter(parsedDates), &
parseDate);
1074 if (!schedule.calendar().empty()) {
1075 for (
auto& d : parsedDates)
1077 d = schedule.calendar().adjust(d, schedule.businessDayConvention());
1094 QL_REQUIRE(parsedDates.front() == Date(),
"Invalid date " << dates.front() <<
" for first node");
1095 if (parsedDates[1] == Date()) {
1097 for (Size i = 2; i < dates.size(); i++) {
1098 QL_REQUIRE(parsedDates[i] == Date(),
"Invalid date " << dates[i] <<
" for node " << i
1099 <<
". Cannot mix dates and non-dates attributes");
1105 Size len = schedule.size() - 1;
1106 vector<T>
data(len);
1107 Size j = 0, max_j = parsedDates.size() - 1;
1108 Date d = parsedDates[j + 1];
1109 for (Size i = 0; i < len; i++) {
1111 while (schedule[i] >= d && j < max_j) {
1114 QL_REQUIRE(parsedDates[j + 1] != Date(),
"Cannot have empty date attribute for node " << j + 1);
1115 d = parsedDates[j + 1];
1118 data[i] = values[j];
1121 if (checkAllValuesAppearInResult) {
1122 auto it = checkAllValuesAppearInScheduledVector<T>(
data, values);
1123 QL_REQUIRE(it == values.end(),
1124 "buildScheduledVector: input value '" << *it <<
" does not appear in the result vector");
1130template <
typename T>
1132 vector<T> res = values;
1133 if (res.size() < schedule.size() - 1)
1134 res.resize(schedule.size() - 1, res.size() == 0 ? defaultValue : res.back());
1138template <
typename T>
1140 const T& defaultValue,
const bool checkAllValuesAppearInResult) {
1145template <
typename T>
1147 const vector<T>& inputValues) {
1148 auto s = scheduledVector.begin();
1149 auto i = inputValues.begin();
1150 while (i != inputValues.end()) {
1151 if (s == scheduledVector.end())
1163Leg
joinLegs(
const std::vector<Leg>& legs);
1167 const QuantLib::ext::shared_ptr<Market>& market,
const std::string& configuration);
Serializable object holding amortization rules.
const string & endDate() const
Amortization end date.
double value() const
Interpretation depending on type()
const string & startDate() const
Amortization start date.
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
const string & type() const
FixedAmount, RelativeToInitialNotional, RelativeToPreviousNotional, Annuity.
AmortizationData(string type, double value, string startDate, string endDate, string frequency, bool underflow)
bool underflow() const
Allow amortization below zero notional if true.
const string & frequency() const
Amortization frequency.
Serializable Constant Maturity Bond Yield Leg Data.
const vector< double > & floors() const
bool hasCreditRisk() const
vector< string > gearingDates_
const vector< double > & spreads() const
vector< double > & floors()
vector< double > gearings_
vector< string > & floorDates()
const vector< string > & gearingDates() const
const string & genericBond() const
vector< string > floorDates_
vector< double > & caps()
virtual void fromXML(XMLNode *node) override
vector< double > spreads_
virtual XMLNode * toXML(XMLDocument &doc) const override
const vector< double > & caps() const
const vector< string > & spreadDates() const
const vector< string > & floorDates() const
CMBLegData()
Default constructor.
const vector< double > & gearings() const
vector< string > & capDates()
const vector< string > & capDates() const
vector< string > capDates_
CMBLegData(const string &genericBond, bool hasCreditRisk, Size fixingDays, bool isInArrears, const vector< double > &spreads, const vector< string > &spreadDates=vector< string >(), const vector< double > &caps=vector< double >(), const vector< string > &capDates=vector< string >(), const vector< double > &floors=vector< double >(), const vector< string > &floorDates=vector< string >(), const vector< double > &gearings=vector< double >(), const vector< string > &gearingDates=vector< string >(), bool nakedOption=false)
Constructor.
vector< string > spreadDates_
Serializable CMS Leg Data.
const vector< double > & floors() const
vector< string > gearingDates_
const vector< double > & spreads() const
vector< double > & floors()
vector< double > gearings_
vector< string > & floorDates()
const vector< string > & gearingDates() const
vector< string > floorDates_
CMSLegData(const string &swapIndex, Size fixingDays, bool isInArrears, const vector< double > &spreads, const vector< string > &spreadDates=vector< string >(), const vector< double > &caps=vector< double >(), const vector< string > &capDates=vector< string >(), const vector< double > &floors=vector< double >(), const vector< string > &floorDates=vector< string >(), const vector< double > &gearings=vector< double >(), const vector< string > &gearingDates=vector< string >(), bool nakedOption=false)
Constructor.
vector< double > & caps()
virtual void fromXML(XMLNode *node) override
vector< double > spreads_
virtual XMLNode * toXML(XMLDocument &doc) const override
CMSLegData()
Default constructor.
const vector< double > & caps() const
const vector< string > & spreadDates() const
const vector< string > & floorDates() const
const vector< double > & gearings() const
vector< string > & capDates()
const vector< string > & capDates() const
vector< string > capDates_
const string & swapIndex() const
vector< string > spreadDates_
Serializable CMS Spread Leg Data.
const vector< double > & floors() const
vector< string > gearingDates_
const vector< double > & spreads() const
vector< double > & floors()
vector< double > gearings_
CMSSpreadLegData()
Default constructor.
vector< string > & floorDates()
const vector< string > & gearingDates() const
vector< string > floorDates_
vector< double > & caps()
virtual void fromXML(XMLNode *node) override
vector< double > spreads_
virtual XMLNode * toXML(XMLDocument &doc) const override
const string & swapIndex1() const
const vector< double > & caps() const
const vector< string > & spreadDates() const
const vector< string > & floorDates() const
const vector< double > & gearings() const
vector< string > & capDates()
const vector< string > & capDates() const
vector< string > capDates_
const string & swapIndex2() const
CMSSpreadLegData(const string &swapIndex1, const string &swapIndex2, Size fixingDays, bool isInArrears, const vector< double > &spreads, const vector< string > &spreadDates=vector< string >(), const vector< double > &caps=vector< double >(), const vector< string > &capDates=vector< string >(), const vector< double > &floors=vector< double >(), const vector< string > &floorDates=vector< string >(), const vector< double > &gearings=vector< double >(), const vector< string > &gearingDates=vector< string >(), bool nakedOption=false)
Constructor.
vector< string > spreadDates_
Serializable CPI Leg Data.
const vector< double > & floors() const
CPILegData()
Default constructor.
const string & observationLag() const
double finalFlowCap() const
const string & interpolation() const
const string & startDate() const
const std::vector< double > & rates() const
const string & index() const
CPILegData(string index, string startDate, double baseCPI, string observationLag, string interpolation, const vector< double > &rates, const vector< string > &rateDates=std::vector< string >(), bool subtractInflationNominal=true, const vector< double > &caps=vector< double >(), const vector< string > &capDates=vector< string >(), const vector< double > &floors=vector< double >(), const vector< string > &floorDates=vector< string >(), double finalFlowCap=Null< Real >(), double finalFlowFloor=Null< Real >(), bool nakedOption=false, bool subtractInflationNominalCoupons=false)
Constructor.
vector< string > floorDates_
virtual void fromXML(XMLNode *node) override
const std::vector< string > & rateDates() const
virtual XMLNode * toXML(XMLDocument &doc) const override
vector< string > rateDates_
const vector< double > & caps() const
bool subtractInflationNominalCoupons_
const vector< string > & floorDates() const
const vector< string > & capDates() const
vector< string > capDates_
bool subtractInflationNominal() const
bool subtractInflationNominal_
double finalFlowFloor() const
bool subtractInflationNominalCoupons() const
Serializable Cashflow Leg Data.
CashflowData(const vector< double > &amounts, const vector< string > &dates)
Constructor.
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
vector< double > amounts_
const vector< string > & dates() const
const vector< double > & amounts() const
CashflowData()
Default constructor.
Serializable Digital CMS Leg Data.
Position::Type callPosition_
vector< double > callPayoffs_
const QuantLib::ext::shared_ptr< CMSLegData > & underlying() const
vector< double > callStrikes_
DigitalCMSLegData(const QuantLib::ext::shared_ptr< CMSLegData > &underlying, Position::Type callPosition=Position::Long, bool isCallATMIncluded=false, const vector< double > callStrikes=vector< double >(), const vector< string > callStrikeDates=vector< string >(), const vector< double > callPayoffs=vector< double >(), const vector< string > callPayoffDates=vector< string >(), Position::Type putPosition=Position::Long, bool isPutATMIncluded=false, const vector< double > putStrikes=vector< double >(), const vector< string > putStrikeDates=vector< string >(), const vector< double > putPayoffs=vector< double >(), const vector< string > putPayoffDates=vector< string >())
Constructor.
const Position::Type putPosition() const
Position::Type putPosition_
const vector< string > callStrikeDates() const
const bool isCallATMIncluded() const
vector< string > callStrikeDates_
const bool isPutATMIncluded() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
const vector< double > callPayoffs() const
vector< string > putPayoffDates_
QuantLib::ext::shared_ptr< CMSLegData > underlying_
const vector< string > callPayoffDates() const
const vector< double > putStrikes() const
vector< double > putPayoffs_
const vector< double > callStrikes() const
const vector< string > putPayoffDates() const
vector< string > putStrikeDates_
vector< string > callPayoffDates_
DigitalCMSLegData()
Default constructor.
const vector< string > putStrikeDates() const
vector< double > putStrikes_
const Position::Type callPosition() const
const vector< double > putPayoffs() const
Serializable Digital CMS Spread Leg Data.
Position::Type callPosition_
vector< double > callPayoffs_
vector< double > callStrikes_
const QuantLib::ext::shared_ptr< CMSSpreadLegData > & underlying() const
const Position::Type putPosition() const
Position::Type putPosition_
const vector< string > callStrikeDates() const
const bool isCallATMIncluded() const
vector< string > callStrikeDates_
const bool isPutATMIncluded() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
const vector< double > callPayoffs() const
vector< string > putPayoffDates_
const vector< string > callPayoffDates() const
const vector< double > putStrikes() const
vector< double > putPayoffs_
const vector< double > callStrikes() const
const vector< string > putPayoffDates() const
vector< string > putStrikeDates_
vector< string > callPayoffDates_
const vector< string > putStrikeDates() const
QuantLib::ext::shared_ptr< CMSSpreadLegData > underlying_
vector< double > putStrikes_
DigitalCMSSpreadLegData(const QuantLib::ext::shared_ptr< CMSSpreadLegData > &underlying, Position::Type callPosition=Position::Long, bool isCallATMIncluded=false, const vector< double > callStrikes=vector< double >(), const vector< string > callStrikeDates=vector< string >(), const vector< double > callPayoffs=vector< double >(), const vector< string > callPayoffDates=vector< string >(), Position::Type putPosition=Position::Long, bool isPutATMIncluded=false, const vector< double > putStrikes=vector< double >(), const vector< string > putStrikeDates=vector< string >(), const vector< double > putPayoffs=vector< double >(), const vector< string > putPayoffDates=vector< string >())
Constructor.
const Position::Type callPosition() const
const vector< double > putPayoffs() const
DigitalCMSSpreadLegData()
Default constructor.
Serializable Fixed Leg Data.
EquityReturnType returnType() const
string initialPriceCurrency_
ScheduleData valuationSchedule_
Natural fixingDays() const
EquityLegData()
Default constructor.
Real dividendFactor() const
EquityUnderlying equityIdentifier() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
EquityReturnType returnType_
const string & initialPriceCurrency() const
bool notionalReset() const
const string & eqCurrency() const
const string & fxIndex() const
EquityLegData(EquityReturnType returnType, Real dividendFactor, EquityUnderlying equityUnderlying, Real initialPrice, bool notionalReset, Natural fixingDays=0, const ScheduleData &valuationSchedule=ScheduleData(), string eqCurrency="", string fxIndex="", Real quantity=Null< Real >(), string initialPriceCurrency="")
Constructor.
EquityUnderlying equityUnderlying_
ScheduleData valuationSchedule() const
Real initialPrice() const
const std::string & name() const override
Serializable Fixed Leg Data.
FixedLegData(const vector< double > &rates, const vector< string > &rateDates=vector< string >())
Constructor.
FixedLegData()
Default constructor.
const vector< double > & rates() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
vector< string > rateDates_
const vector< string > & rateDates() const
Serializable Floating Leg Data.
const vector< double > & floors() const
QuantLib::Period lookback() const
QuantLib::Size rateCutoff() const
FloatingLegData()
Default constructor.
const std::map< QuantLib::Date, double > & historicalFixings() const
vector< string > gearingDates_
std::map< QuantLib::Date, double > historicalFixings_
bool telescopicValueDates_
const vector< double > & spreads() const
QuantLib::Size fixingDays() const
bool includeSpread() const
vector< double > & floors()
vector< double > gearings_
vector< string > & floorDates()
ScheduleData resetSchedule_
ScheduleData fixingSchedule() const
const vector< string > & gearingDates() const
QuantLib::Size rateCutoff_
const string & index() const
ScheduleData resetSchedule() const
vector< string > floorDates_
boost::optional< Period > lastRecentPeriod_
boost::optional< bool > isInArrears_
vector< double > & caps()
boost::optional< bool > isInArrears() const
virtual void fromXML(XMLNode *node) override
vector< double > spreads_
virtual XMLNode * toXML(XMLDocument &doc) const override
std::string lastRecentPeriodCalendar_
ScheduleData fixingSchedule_
const vector< double > & caps() const
QuantLib::Size fixingDays_
bool localCapFloor() const
const vector< string > & spreadDates() const
const vector< string > & floorDates() const
bool & telescopicValueDates()
const boost::optional< Period > & lastRecentPeriod() const
const vector< double > & gearings() const
const std::string & lastRecentPeriodCalendar() const
vector< string > & capDates()
bool hasSubPeriods() const
const vector< string > & capDates() const
vector< string > capDates_
FloatingLegData(const string &index, QuantLib::Size fixingDays, bool isInArrears, const vector< double > &spreads, const vector< string > &spreadDates=vector< string >(), const vector< double > &caps=vector< double >(), const vector< string > &capDates=vector< string >(), const vector< double > &floors=vector< double >(), const vector< string > &floorDates=vector< string >(), const vector< double > &gearings=vector< double >(), const vector< string > &gearingDates=vector< string >(), bool isAveraged=false, bool nakedOption=false, bool hasSubPeriods=false, bool includeSpread=false, QuantLib::Period lookback=0 *Days, const Size rateCutoff=Null< Size >(), bool localCapFloor=false, const boost::optional< Period > &lastRecentPeriod=boost::none, const std::string &lastRecentPeriodCalendar=std::string(), bool telescopicValueDates=false, const std::map< QuantLib::Date, double > &historicalFixings={})
Constructor.
QuantLib::Period lookback_
bool telescopicValueDates() const
vector< string > spreadDates_
Serializable Additional Leg Data.
std::set< std::string > indices_
const string & legNodeName() const
const string & legType() const
const std::set< std::string > & indices() const
LegAdditionalData(const string &legType, const string &legNodeName)
LegAdditionalData(const string &legType)
Serializable object holding leg data.
bool & strictNotionalDates()
QuantLib::ext::shared_ptr< LegAdditionalData > & concreteLegData()
std::vector< std::string > & paymentDates()
const std::vector< AmortizationData > & amortizationData() const
const string & paymentConvention() const
std::set< std::string > indices_
const string & currency() const
bool notionalFinalExchange() const
const std::vector< std::string > & paymentDates() const
double foreignAmount() const
const ScheduleData & paymentSchedule() const
string notionalPaymentLag_
ScheduleData & schedule()
const ScheduleData & schedule() const
bool notionalFinalExchange_
vector< double > notionals_
LegData()
Default constructor.
const string & foreignCurrency() const
bool & indexingFromAssetLeg()
bool indexingFromAssetLeg_
vector< double > & notionals()
bool notionalInitialExchange_
bool notionalAmortizingExchange() const
const std::vector< Indexing > & indexing() const
std::vector< std::string > paymentDates_
virtual QuantLib::ext::shared_ptr< LegAdditionalData > initialiseConcreteLegData(const string &)
string & lastPeriodDayCounter()
QuantLib::ext::shared_ptr< LegAdditionalData > concreteLegData_
virtual void fromXML(XMLNode *node) override
ScheduleData paymentSchedule_
virtual XMLNode * toXML(XMLDocument &doc) const override
const string & legType() const
const std::string & paymentCalendar() const
std::vector< Indexing > indexing_
bool strictNotionalDates_
const bool indexingFromAssetLeg() const
std::string paymentCalendar_
vector< string > notionalDates_
const string & fxIndex() const
const std::set< std::string > & indices() const
bool strictNotionalDates() const
const string & dayCounter() const
bool isNotResetXCCY() const
const vector< string > & notionalDates() const
const string & paymentLag() const
vector< string > & notionalDates()
string lastPeriodDayCounter_
string & paymentConvention()
const string & lastPeriodDayCounter() const
bool notionalInitialExchange() const
string paymentConvention_
std::vector< AmortizationData > amortizationData_
std::vector< Indexing > & indexing()
QuantLib::ext::shared_ptr< LegAdditionalData > concreteLegData() const
const vector< double > & notionals() const
bool notionalAmortizingExchange_
const string & notionalPaymentLag() const
Serializable schedule data.
Small XML Document wrapper class.
Base class for all serializable classes.
Serializable YoY Leg Data.
const vector< double > & floors() const
const std::vector< double > & gearings() const
bool addInflationNotional_
vector< string > gearingDates_
const std::vector< string > & spreadDates() const
const std::vector< double > & spreads() const
vector< double > gearings_
YoYLegData()
Default constructor.
const string index() const
vector< string > floorDates_
const std::vector< string > & gearingDates() const
virtual void fromXML(XMLNode *node) override
vector< double > spreads_
virtual XMLNode * toXML(XMLDocument &doc) const override
const vector< double > & caps() const
const vector< string > & floorDates() const
bool irregularYoY() const
const string observationLag() const
const vector< string > & capDates() const
vector< string > capDates_
bool addInflationNotional() const
YoYLegData(string index, string observationLag, Size fixingDays, const vector< double > &gearings=std::vector< double >(), const vector< string > &gearingDates=std::vector< string >(), const vector< double > &spreads=std::vector< double >(), const vector< string > &spreadDates=std::vector< string >(), const vector< double > &caps=vector< double >(), const vector< string > &capDates=vector< string >(), const vector< double > &floors=vector< double >(), const vector< string > &floorDates=vector< string >(), bool nakedOption=false, bool addInflationNotional=false, bool irregularYoY=false)
Constructor.
vector< string > spreadDates_
Serializable Fixed Leg Data.
const vector< double > & rates() const
ZeroCouponFixedLegData()
Default constructor.
ZeroCouponFixedLegData(const vector< double > &rates, const vector< string > &rateDates=vector< string >(), const string &compounding="Compounded", const bool subtractNotional=true)
Constructor.
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
const bool & subtractNotional() const
vector< string > rateDates_
const vector< string > & rateDates() const
const string & compounding() const
Logic for calculating required fixing dates on legs.
Date parseDate(const string &s)
Convert std::string to QuantLib::Date.
string internalIndexName(const string &indexName)
leg indexing data model and serialization
Map text representations to QuantLib/QuantExt types.
Leg data factory that can be used to build instances of leg data.
Leg makeOISLeg(const LegData &data, const QuantLib::ext::shared_ptr< OvernightIndex > &index, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const bool attachPricer, const QuantLib::Date &openEndDateReplacement)
vector< T > normaliseToSchedule(const vector< T > &values, const Schedule &schedule, const T &defaultValue)
vector< T > buildScheduledVectorNormalised(const vector< T > &values, const vector< string > &dates, const Schedule &schedule, const T &defaultValue, const bool checkAllValuesAppearInResult=false)
Leg makeDigitalCMSLeg(const LegData &data, const QuantLib::ext::shared_ptr< QuantLib::SwapIndex > &swapIndex, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const bool attachPricer, const QuantLib::Date &openEndDateReplacement)
Leg makeSimpleLeg(const LegData &data)
vector< double > buildAmortizationScheduleFixedAmount(const vector< double > ¬ionals, const Schedule &schedule, const AmortizationData &data)
vector< double > buildAmortizationScheduleRelativeToInitialNotional(const vector< double > ¬ionals, const Schedule &schedule, const AmortizationData &data)
Real currentNotional(const Leg &leg)
std::pair< std::string, SimmCreditQualifierMapping > getCmbLegCreditQualifierMapping(const CMBLegData &ld, const QuantLib::ext::shared_ptr< ReferenceDataManager > &refData, const std::string &tradeId, const std::string &tradeType)
void applyAmortization(std::vector< Real > ¬ionals, const LegData &data, const Schedule &schedule, const bool annuityAllowed, const std::vector< Real > &rates)
vector< double > buildAmortizationScheduleRelativeToPreviousNotional(const vector< double > ¬ionals, const Schedule &schedule, const AmortizationData &data)
void applyIndexing(Leg &leg, const LegData &data, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, RequiredFixings &requiredFixings, const QuantLib::Date &openEndDateReplacement, const bool useXbsCurves)
Leg makeBMALeg(const LegData &data, const QuantLib::ext::shared_ptr< QuantExt::BMAIndexWrapper > &indexWrapper, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const QuantLib::Date &openEndDateReplacement)
vector< double > buildAmortizationScheduleFixedAnnuity(const vector< double > ¬ionals, const vector< double > &rates, const Schedule &schedule, const AmortizationData &data, const DayCounter &dc)
Leg buildNotionalLeg(const LegData &data, const Leg &leg, RequiredFixings &requiredFixings, const QuantLib::ext::shared_ptr< Market > &market, const std::string &configuration)
Real originalNotional(const Leg &leg)
Leg makeCMBLeg(const LegData &data, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const bool attachPricer, const QuantLib::Date &openEndDateReplacement)
Leg makeYoYLeg(const LegData &data, const QuantLib::ext::shared_ptr< InflationIndex > &index, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const QuantLib::Date &openEndDateReplacement)
vector< T > buildScheduledVector(const vector< T > &values, const vector< string > &dates, const Schedule &schedule, const bool checkAllValuesAppearInResult=false)
Leg makeCMSSpreadLeg(const LegData &data, const QuantLib::ext::shared_ptr< QuantLib::SwapSpreadIndex > &swapSpreadIndex, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const bool attachPricer, const QuantLib::Date &openEndDateReplacement)
Leg makeDigitalCMSSpreadLeg(const LegData &data, const QuantLib::ext::shared_ptr< QuantLib::SwapSpreadIndex > &swapSpreadIndex, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const QuantLib::Date &openEndDateReplacement)
Leg makeCPILeg(const LegData &data, const QuantLib::ext::shared_ptr< ZeroInflationIndex > &index, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const QuantLib::Date &openEndDateReplacement)
vector< T >::const_iterator checkAllValuesAppearInScheduledVector(const vector< T > &scheduledVecotr, const vector< T > &inputValues)
Leg makeCMSLeg(const LegData &data, const QuantLib::ext::shared_ptr< QuantLib::SwapIndex > &swapIndex, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const bool attachPricer, const QuantLib::Date &openEndDateReplacement)
Leg makeEquityLeg(const LegData &data, const QuantLib::ext::shared_ptr< EquityIndex2 > &equityCurve, const QuantLib::ext::shared_ptr< QuantExt::FxIndex > &fxIndex, const QuantLib::Date &openEndDateReplacement)
std::string getCmbLegCreditRiskCurrency(const CMBLegData &ld, const QuantLib::ext::shared_ptr< ReferenceDataManager > &refData)
Leg makeZCFixedLeg(const LegData &data, const QuantLib::Date &openEndDateReplacement)
Leg makeIborLeg(const LegData &data, const QuantLib::ext::shared_ptr< IborIndex > &index, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const bool attachPricer, const QuantLib::Date &openEndDateReplacement)
Leg makeFixedLeg(const LegData &data, const QuantLib::Date &openEndDateReplacement)
Leg makeNotionalLeg(const Leg &refLeg, const bool initNomFlow, const bool finalNomFlow, const bool amortNomFlow, const Natural notionalPaymentLag, const BusinessDayConvention paymentConvention, const Calendar paymentCalendar, const bool excludeIndexing)
Leg joinLegs(const std::vector< Leg > &legs)
Serializable Credit Default Swap.
Map text representations to QuantLib/QuantExt types.
trade schedule data model and serialization
mapping of SIMM credit qualifiers