111 const std::string& startDate =
"",
const std::string& endDate =
"");
115 const std::string& startDate =
"",
const std::string& endDate =
"");
163 virtual void build(
const QuantLib::ext::shared_ptr<EngineFactory>&)
override;
169 std::map<AssetClass, std::set<std::string>>
170 underlyingIndices(
const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceDataManager =
nullptr)
const override;
173 virtual void fromXML(
XMLNode* node)
override;
185 QuantLib::ext::shared_ptr<QuantLib::Bond>
bond;
199 virtual Result build(
const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
200 const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceData,
201 const std::string& securityId)
const = 0;
204class BondFactory :
public QuantLib::Singleton<BondFactory, std::integral_constant<bool, true>> {
205 map<std::string, QuantLib::ext::shared_ptr<BondBuilder>>
builders_;
210 const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceData,
211 const std::string& securityId)
const;
212 void addBuilder(
const std::string& referenceDataType,
const QuantLib::ext::shared_ptr<BondBuilder>& builder,
213 const bool allowOverwrite =
false);
217 virtual Result build(
const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
218 const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceData,
219 const std::string& securityId)
const override;
const string & securityId() const
std::vector< LegData > coupons_
std::string isdaBaseProduct() const
return isda sub type "Single Name", "Index" or throw if sub type can not be mapped
bool hasCreditRisk() const
const string & currency() const
const string & subType() const
string volatilityCurveId_
string priceQuoteBaseValue_
BondData(string issuerId, string creditCurveId, string securityId, string referenceCurveId, string settlementDays, string calendar, string issueDate, LegData &coupons, bool hasCreditRisk=true)
Constructor for coupon bonds.
BondData(string securityId, Real bondNotional, bool hasCreditRisk=true)
Constructor to set up a bond from reference data.
Real priceQuoteBaseValue() const
const string & volatilityCurveId() const
const std::vector< LegData > & coupons() const
void populateFromBondReferenceData(const QuantLib::ext::shared_ptr< BondReferenceDatum > &referenceDatum, const std::string &startDate="", const std::string &endDate="")
populate data from reference datum and check data for completeness
const string & issuerId() const
Inspectors.
const string & creditGroup() const
const string & referenceCurveId() const
const string & issueDate() const
virtual void fromXML(XMLNode *node) override
XMLSerializable interface.
virtual XMLNode * toXML(XMLDocument &doc) const override
const string & settlementDays() const
BondData(string issuerId, string creditCurveId, string securityId, string referenceCurveId, string settlementDays, string calendar, string issueDate, const std::vector< LegData > &coupons, bool hasCreditRisk=true)
Constructor for coupon bonds with multiple phases (represented as legs)
const string & calendar() const
BondData()
Default Contructor.
bool isInflationLinked() const
void checkData() const
check data for completeness
const string & maturityDate() const
const string & incomeCurveId() const
QuantExt::BondIndex::PriceQuoteMethod priceQuoteMethod() const
BondData(string issuerId, string creditCurveId, string securityId, string referenceCurveId, string settlementDays, string calendar, Real faceAmount, string maturityDate, string currency, string issueDate, bool hasCreditRisk=true)
Constructor for zero bonds, FIXME these can only be set up via this ctor, not via fromXML()
const string & creditCurveId() const
Real bondNotional() const
void addBuilder(const std::string &referenceDataType, const QuantLib::ext::shared_ptr< BondBuilder > &builder, const bool allowOverwrite=false)
map< std::string, QuantLib::ext::shared_ptr< BondBuilder > > builders_
boost::shared_mutex mutex_
BondBuilder::Result build(const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceData, const std::string &securityId) const
BondData originalBondData_
Bond(Envelope env, const BondData &bondData)
Constructor taking an envelope and bond data.
Bond()
Default Constructor.
const BondData & bondData() const
inspectors
Serializable object holding generic trade data, reporting dimensions.
Serializable object holding leg data.
Small XML Document wrapper class.
Base class for all serializable classes.
leg data model and serialization
Serializable Credit Default Swap.
Reference data model and serialization.
QuantLib::ext::shared_ptr< QuantExt::ModelBuilder > modelBuilder
std::string creditCurveId
QuantLib::ext::shared_ptr< QuantLib::Bond > bond
QuantExt::BondIndex::PriceQuoteMethod priceQuoteMethod
double inflationFactor() const
double priceQuoteBaseValue
Bond Factory that builds bonds from reference data.
virtual Result build(const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceData, const std::string &securityId) const =0
virtual Result build(const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceData, const std::string &securityId) const override
base trade data model and serialization