Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
indexcreditdefaultswapdata.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2017 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#pragma once
20
25#include <ql/instruments/creditdefaultswap.hpp>
26
27namespace ore {
28namespace data {
29
31public:
32 //! Default constructor
34
35 using PPT = QuantExt::CreditDefaultSwap::ProtectionPaymentTime;
36
37 //! Detailed constructor
39 const BasketData& basket,
41 const bool settlesAccrual = true,
42 const PPT protectionPaymentTime = PPT::atDefault,
43 const QuantLib::Date& protectionStart = QuantLib::Date(),
44 const QuantLib::Date& upfrontDate = QuantLib::Date(),
45 const QuantLib::Real upfrontFee = QuantLib::Null<QuantLib::Real>(),
46 const QuantLib::Date& tradeDate = QuantLib::Date(),
47 const std::string& cashSettlementDays = "",
48 const bool rebatesAccrual = true);
49
50 //! \name XMLSerializable interface
51 //@{
52 void fromXML(ore::data::XMLNode* node) override;
54 //@}
55
56 //! \name Inspectors
57 //@{
58 const BasketData& basket() const { return basket_; }
59 //@}
60
61 /*! Get credit curve id with term suffix "_5Y". If the creditCurveId contains such a suffix already
62 this is used. Otherwise we try to imply it from the schedule. If that is not possible, the
63 creditCurveId without tenor is returned. */
64 std::string creditCurveIdWithTerm() const;
65
66 /*! If set this is used to derive the term instead of the schedule start date. A concession to bad
67 trade setups really, where the start date is not set to the index effective date */
68 void setIndexStartDateHint(const QuantLib::Date& d) const { indexStartDateHint_ = d; }
69
70 /*! Get the index start date hint, or null if it was never set */
71 const QuantLib::Date& indexStartDateHint() const { return indexStartDateHint_; }
72
73protected:
74 //! \name CreditDefaultSwapData interface
75 //@{
76 void check(ore::data::XMLNode* node) const override;
78 //@}
79
80private:
82 mutable QuantLib::Date indexStartDateHint_;
83};
84
85} // namespace data
86} // namespace ore
credit basket data model and serialization
QuantLib::Natural cashSettlementDays() const
const QuantLib::Date & tradeDate() const
ore::data::XMLNode * alloc(ore::data::XMLDocument &doc) const override
IndexCreditDefaultSwapData(const std::string &creditCurveId, const BasketData &basket, const ore::data::LegData &leg, const bool settlesAccrual=true, const PPT protectionPaymentTime=PPT::atDefault, const QuantLib::Date &protectionStart=QuantLib::Date(), const QuantLib::Date &upfrontDate=QuantLib::Date(), const QuantLib::Real upfrontFee=QuantLib::Null< QuantLib::Real >(), const QuantLib::Date &tradeDate=QuantLib::Date(), const std::string &cashSettlementDays="", const bool rebatesAccrual=true)
Detailed constructor.
void setIndexStartDateHint(const QuantLib::Date &d) const
void fromXML(ore::data::XMLNode *node) override
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
QuantExt::CreditDefaultSwap::ProtectionPaymentTime PPT
const QuantLib::Date & indexStartDateHint() const
Serializable object holding leg data.
Definition: legdata.hpp:844
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
A class to hold credit default swap data.
leg data model and serialization
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
base trade data model and serialization