Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
bondtotalreturnswap.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 ored/portfolio/bond.hpp
20 \brief Bond trade data model and serialization
21 \ingroup tradedata
22 */
23#pragma once
24
29
31
32namespace ore {
33namespace data {
34
35class BondTRS : public Trade {
36public:
37 //! Default Constructor
38 BondTRS() : Trade("BondTRS") {}
39
40 //! Constructor for coupon bonds
41 BondTRS(Envelope env, const BondData& bondData)
42 : Trade("BondTRS", env), originalBondData_(bondData), bondData_(bondData) {}
43
44 virtual void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
45
46 virtual void fromXML(XMLNode* node) override;
47 virtual XMLNode* toXML(XMLDocument& doc) const override;
48
49 //! Add underlying Bond names
50 std::map<AssetClass, std::set<std::string>>
51 underlyingIndices(const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceDataManager = nullptr) const override;
52
53 const BondData& bondData() const { return bondData_; }
54
55 const ScheduleData& scheduleData() const { return scheduleData_; }
56 const LegData& fundingLegData() const { return fundingLegData_; }
57 const bool payTotalReturnLeg() const { return payTotalReturnLeg_; }
58 const Real initialPrice() const { return initialPrice_; }
59 const bool useDirtyPrices() const { return useDirtyPrices_; }
60 const std::string& observationLag() const { return observationLag_; }
61 const std::string& observationConvention() const { return observationConvention_; }
62 const std::string& observationCalendar() const { return observationCalendar_; }
63 const std::string& paymentLag() const { return paymentLag_; }
64 const std::string& paymentConvention() const { return paymentConvention_; }
65 const std::string& paymentCalendar() const { return paymentCalendar_; }
66 const std::vector<std::string>& paymentDates() { return paymentDates_; }
67
68private:
69 // underlying bond data
71
72 // total return data
75 bool payTotalReturnLeg_ = false;
76 Real initialPrice_ = Null<Real>();
77 bool useDirtyPrices_ = true;
79 std::string observationLag_;
82 std::string paymentLag_;
83 std::string paymentConvention_;
84 std::string paymentCalendar_;
85 std::vector<std::string> paymentDates_;
86
87 // optional fx terms for composite bond trs
88 string fxIndex_ = "";
89};
90} // namespace data
91} // namespace ore
Bond trade data model and serialization.
bool payBondCashFlowsImmediately_
boost::shared_ptr< QuantExt::FxIndex > fxIndex_
std::vector< Date > paymentDates_
std::string observationConvention_
const std::string & observationConvention() const
const bool payTotalReturnLeg() const
const bool useDirtyPrices() const
const ScheduleData & scheduleData() const
std::vector< std::string > paymentDates_
BondTRS()
Default Constructor.
const std::string & observationCalendar() const
const std::string & paymentCalendar() const
const std::string & observationLag() const
const LegData & fundingLegData() const
const std::vector< std::string > & paymentDates()
const std::string & paymentLag() const
const Real initialPrice() const
std::string observationCalendar_
const std::string & paymentConvention() const
BondTRS(Envelope env, const BondData &bondData)
Constructor for coupon bonds.
const BondData & bondData() const
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
Serializable object holding leg data.
Definition: legdata.hpp:844
Serializable schedule data.
Definition: schedule.hpp:202
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
Reference data model and serialization.
trade schedule data model and serialization
base trade data model and serialization