Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
forwardbond.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2019 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file portfolio/bond.hpp
20 \brief Bond trade data model and serialization
21 \ingroup tradedata
22 */
23#pragma once
24
27
28namespace ore {
29namespace data {
30
31class ForwardBond : public Trade {
32public:
33 //! Default constructor
34 ForwardBond() : Trade("ForwardBond") {}
35
36 //! Constructor taking an envelope and bond data
37 ForwardBond(Envelope env, const BondData& bondData, string fwdMaturityDate, string fwdSettlementDate,
38 string settlement, string amount, string lockRate, string lockRateDayCounter, string settlementDirty,
39 string compensationPayment, string compensationPaymentDate, string longInForward, string dv01 = string())
40 : Trade("ForwardBond", env), originalBondData_(bondData), bondData_(bondData),
41 fwdMaturityDate_(fwdMaturityDate), fwdSettlementDate_(fwdSettlementDate), settlement_(settlement),
42 amount_(amount), lockRate_(lockRate), lockRateDayCounter_(lockRateDayCounter),
43 settlementDirty_(settlementDirty), compensationPayment_(compensationPayment),
44 compensationPaymentDate_(compensationPaymentDate), longInForward_(longInForward), dv01_(dv01) {}
45
46 virtual void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
47
48 virtual void fromXML(XMLNode* node) override;
49 virtual XMLNode* toXML(XMLDocument& doc) const override;
50
51 //! Add underlying Bond names
52 std::map<AssetClass, std::set<std::string>>
53 underlyingIndices(const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceDataManager = nullptr) const override;
54
55 //! inspectors
56 const BondData& bondData() const { return bondData_; }
57
58 const string& fwdMaturityDate() const { return fwdMaturityDate_; }
59 const string& fwdSettlementDate() const { return fwdSettlementDate_; }
60 const string& settlement() const { return settlement_; }
61 const string& amount() const { return amount_; }
62 const string& lockRate() const { return lockRate_; }
63 const string& lockRateDayCounter() const { return lockRateDayCounter_; }
64 const string& settlementDirty() const { return settlementDirty_; }
65 const string& compensationPayment() const { return compensationPayment_; }
66 const string& compensationPaymentDate() const { return compensationPaymentDate_; }
67 const string& longInForward() const { return longInForward_; }
68 const string& dv01() const { return dv01_; }
69
70protected:
72 string currency_;
73
77 string amount_;
78 string lockRate_;
84 string dv01_;
85};
86} // namespace data
87} // namespace ore
Bond trade data model and serialization.
DayCounter lockRateDayCounter_
boost::optional< bool > longInForward_
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
const string & settlementDirty() const
Definition: forwardbond.hpp:64
ForwardBond()
Default constructor.
Definition: forwardbond.hpp:34
const string & fwdMaturityDate() const
Definition: forwardbond.hpp:58
const string & compensationPayment() const
Definition: forwardbond.hpp:65
const string & compensationPaymentDate() const
Definition: forwardbond.hpp:66
ForwardBond(Envelope env, const BondData &bondData, string fwdMaturityDate, string fwdSettlementDate, string settlement, string amount, string lockRate, string lockRateDayCounter, string settlementDirty, string compensationPayment, string compensationPaymentDate, string longInForward, string dv01=string())
Constructor taking an envelope and bond data.
Definition: forwardbond.hpp:37
const string & settlement() const
Definition: forwardbond.hpp:60
const string & dv01() const
Definition: forwardbond.hpp:68
const string & lockRateDayCounter() const
Definition: forwardbond.hpp:63
const string & longInForward() const
Definition: forwardbond.hpp:67
const string & lockRate() const
Definition: forwardbond.hpp:62
const string & fwdSettlementDate() const
Definition: forwardbond.hpp:59
const string & amount() const
Definition: forwardbond.hpp:61
const BondData & bondData() const
inspectors
Definition: forwardbond.hpp:56
Trade base class.
Definition: trade.hpp:55
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
base trade data model and serialization