Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
convertiblebond.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 Quaternion Risk Management Ltd
3
4 This file is part of ORE, a free-software/open-source library
5 for transparent pricing and risk analysis - http://opensourcerisk.org
6
7 ORE is free software: you can redistribute it and/or modify it
8 under the terms of the Modified BSD License. You should have received a
9 copy of the license along with this program.
10 The license is also available online at <http://opensourcerisk.org>
11
12 This program is distributed on the basis that it will form a useful
13 contribution to risk analytics and model standardisation, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
16*/
17
18/*! \file ored/portfolio/convertiblebond.hpp
19 \brief Convertible Bond trade data model and serialization
20 \ingroup tradedata
21 */
22
23#pragma once
24
29
30namespace ore {
31namespace data {
32
33//! Serializable Convertible Bond
34class ConvertibleBond : public Trade {
35public:
36 //! Default constructor
37 ConvertibleBond() : Trade("ConvertibleBond") {}
38
39 //! Constructor for coupon bonds
41 : Trade("ConvertibleBond", env), originalData_(data), data_(data) {}
42
43 void build(const QuantLib::ext::shared_ptr<ore::data::EngineFactory>&) override;
44 void fromXML(XMLNode* node) override;
45 XMLNode* toXML(XMLDocument& doc) const override;
46
47 //! Add underlying Bond names
48 std::map<AssetClass, std::set<std::string>>
49 underlyingIndices(const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceDataManager = nullptr) const override;
50
51 const ConvertibleBondData& data() const { return data_; }
52 const BondData& bondData() const { return data_.bondData(); }
53
54private:
57};
58
60 void
61 build(const std::string& parentId, const QuantLib::ext::shared_ptr<Trade>& underlying,
62 const std::vector<Date>& valuationDates, const std::vector<Date>& paymentDates,
63 const std::string& fundingCurrency, const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
64 QuantLib::ext::shared_ptr<QuantLib::Index>& underlyingIndex, Real& underlyingMultiplier,
65 std::map<std::string, double>& indexQuantities, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices,
66 Real& initialPrice, std::string& assetCurrency, std::string& creditRiskCurrency,
67 std::map<std::string, SimmCreditQualifierMapping>& creditQualifierMapping, Date& maturity,
68 const std::function<QuantLib::ext::shared_ptr<QuantExt::FxIndex>(
69 const QuantLib::ext::shared_ptr<Market> market, const std::string& configuration, const std::string& domestic,
70 const std::string& foreign, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices)>&
71 getFxIndex,
72 const std::string& underlyingDerivativeId, RequiredFixings& fixings, std::vector<Leg>& returnLegs) const override;
73 void updateUnderlying(const QuantLib::ext::shared_ptr<ReferenceDataManager>& refData, QuantLib::ext::shared_ptr<Trade>& underlying,
74 const std::string& parentId) const override;
75};
76
78 BondBuilder::Result build(const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
79 const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceData,
80 const std::string& securityId) const override;
81};
82
83} // namespace data
84} // namespace ore
Bond trade data model and serialization.
const ore::data::BondData & bondData() const
ConvertibleBond(const Envelope &env, const ConvertibleBondData &data)
Constructor for coupon bonds.
ConvertibleBondData data_
ConvertibleBondData originalData_
const BondData & bondData() const
ConvertibleBond()
Default constructor.
const ConvertibleBondData & data() const
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
Trade base class.
Definition: trade.hpp:55
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
convertible bond data model and serialization
@ data
Definition: log.hpp:77
Time maturity
Definition: utilities.cpp:66
Serializable Credit Default Swap.
Definition: namespaces.docs:23
Bond Factory that builds bonds from reference data.
Definition: bond.hpp:182
BondBuilder::Result build(const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceData, const std::string &securityId) const override
void updateUnderlying(const QuantLib::ext::shared_ptr< ReferenceDataManager > &refData, QuantLib::ext::shared_ptr< Trade > &underlying, const std::string &parentId) const override
void build(const std::string &parentId, const QuantLib::ext::shared_ptr< Trade > &underlying, const std::vector< Date > &valuationDates, const std::vector< Date > &paymentDates, const std::string &fundingCurrency, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, QuantLib::ext::shared_ptr< QuantLib::Index > &underlyingIndex, Real &underlyingMultiplier, std::map< std::string, double > &indexQuantities, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices, Real &initialPrice, std::string &assetCurrency, std::string &creditRiskCurrency, std::map< std::string, SimmCreditQualifierMapping > &creditQualifierMapping, Date &maturity, const std::function< QuantLib::ext::shared_ptr< QuantExt::FxIndex >(const QuantLib::ext::shared_ptr< Market > market, const std::string &configuration, const std::string &domestic, const std::string &foreign, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices)> &getFxIndex, const std::string &underlyingDerivativeId, RequiredFixings &fixings, std::vector< Leg > &returnLegs) const override
base trade data model and serialization