Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
indexcreditdefaultswapoption.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
26
27namespace ore {
28namespace data {
29
31public:
32 //! Default constructor
34
35 //! Detailed constructor
37 const ore::data::OptionData& option, QuantLib::Real strike,
38 const std::string& indexTerm = "", const std::string& strikeType = "Spread",
39 const QuantLib::Date& tradeDate = Date(), const QuantLib::Date& fepStartDate = Date());
40
41 //! \name Trade
42 //@{
43 void build(const QuantLib::ext::shared_ptr<EngineFactory>&) override;
44 QuantLib::Real notional() const override;
45 //@}
46
47 //! \name Serialisation
48 //@{
49 void fromXML(ore::data::XMLNode* node) override;
51 //@}
52
53 //! \name Inspectors
54 //@{
55 const IndexCreditDefaultSwapData& swap() const;
56 const ore::data::OptionData& option() const;
57 const std::string& indexTerm() const;
58 QuantLib::Real strike() const;
59 QuantLib::Option::Type callPut() const;
60 const std::string& strikeType() const;
61 const QuantLib::Date& tradeDate() const;
62 const QuantLib::Date& fepStartDate() const;
64 // only available after build()
65 QuantLib::Real effectiveStrike() const;
66 const std::string& effectiveStrikeType() const;
67 const QuantLib::Period& effectiveIndexTerm() const;
68 std::string creditCurveId() const;
69 const std::string& volCurveId() const;
70 const std::map<std::string, QuantLib::Real>& constituents() const;
71 //@}
72
73private:
76 QuantLib::Real strike_;
77 std::string indexTerm_;
78 std::string strikeType_;
79 QuantLib::Date tradeDate_;
80 QuantLib::Date fepStartDate_;
82
83 QuantLib::Real effectiveStrike_;
85 QuantLib::Period effectiveIndexTerm_;
86 std::string volCurveId_;
87
88 //! Hold related notionals that are known on valuation date.
89 struct Notionals {
90 //! Notional assuming no defaults i.e. an index factor of 1. Equal to notional on \c swap_.
91 QuantLib::Real full = 0.0;
92 //! Outstanding index notional on the trade date of the index CDS option.
93 QuantLib::Real tradeDate = 0.0;
94 //! Outstanding index notional on the valuation date of the index CDS option.
95 QuantLib::Real valuationDate = 0.0;
96 //! The realised front end protection amount, as of the valuation date, that would be due on option exercise.
97 QuantLib::Real realisedFep = 0.0;
98 };
99
100 //! Populated during trade building
102
103 //! map of all the constituents to notionals
104 map<string, Real> constituents_;
105
106 //! Populate constituent notionals and curve IDs from basket data
107 void fromBasket(const QuantLib::Date& asof, std::map<std::string, QuantLib::Real>& constituents);
108
109 //! Populate constituent notionals and curve IDs from reference data
110 void fromReferenceData(const QuantLib::Date& asof, std::map<std::string, QuantLib::Real>& constituents,
111 const QuantLib::ext::shared_ptr<ReferenceDataManager>& refData);
112};
113
114} // namespace data
115} // namespace ore
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
const ore::data::OptionData & option() const
const IndexCreditDefaultSwapData & swap() const
const CreditPortfolioSensitivityDecomposition sensitivityDecomposition() const
void fromXML(ore::data::XMLNode *node) override
void fromBasket(const QuantLib::Date &asof, std::map< std::string, QuantLib::Real > &constituents)
Populate constituent notionals and curve IDs from basket data.
IndexCreditDefaultSwapOption(const ore::data::Envelope &env, const IndexCreditDefaultSwapData &swap, const ore::data::OptionData &option, QuantLib::Real strike, const std::string &indexTerm="", const std::string &strikeType="Spread", const QuantLib::Date &tradeDate=Date(), const QuantLib::Date &fepStartDate=Date())
Detailed constructor.
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
void fromReferenceData(const QuantLib::Date &asof, std::map< std::string, QuantLib::Real > &constituents, const QuantLib::ext::shared_ptr< ReferenceDataManager > &refData)
Populate constituent notionals and curve IDs from reference data.
const std::map< std::string, QuantLib::Real > & constituents() const
CreditPortfolioSensitivityDecomposition sensitivityDecomposition_
Notionals notionals_
Populated during trade building.
map< string, Real > constituents_
map of all the constituents to notionals
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
QuantLib::Real notional() const override
Return the current notional in npvCurrency. See individual sub-classes for the precise definition.
Serializable object holding option data.
Definition: optiondata.hpp:42
Trade base class.
Definition: trade.hpp:55
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
@ data
Definition: log.hpp:77
CreditPortfolioSensitivityDecomposition
Enumeration CreditPortfolioSensitivityDecomposition.
Definition: parsers.hpp:568
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade option data model and serialization
Reference data model and serialization.
Hold related notionals that are known on valuation date.
QuantLib::Real realisedFep
The realised front end protection amount, as of the valuation date, that would be due on option exerc...
QuantLib::Real tradeDate
Outstanding index notional on the trade date of the index CDS option.
QuantLib::Real full
Notional assuming no defaults i.e. an index factor of 1. Equal to notional on swap_.
QuantLib::Real valuationDate
Outstanding index notional on the valuation date of the index CDS option.
base trade data model and serialization