Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
creditlinkedswap.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2021 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/creditlinkedswap.hpp
20 \brief credit linked swap data model
21 \ingroup portfolio
22*/
23
24#pragma once
25
27
29
30namespace ore {
31namespace data {
33using std::string;
34using std::vector;
35
36class CreditLinkedSwap : public Trade {
37public:
38 CreditLinkedSwap() : Trade("CreditLinkedSwap") {}
39 CreditLinkedSwap(const std::string& creditCurveId, const bool settlesAccrual, const Real fixedRecoveryRate,
40 const QuantExt::CreditDefaultSwap::ProtectionPaymentTime& defaultPaymentTime,
41 const std::vector<LegData>& independentPayments, const std::vector<LegData>& contingentPayments,
42 const std::vector<LegData>& defaultPayments, const std::vector<LegData>& recoveryPayments)
43 : Trade("CreditLinkedSwap"), creditCurveId_(creditCurveId), settlesAccrual_(settlesAccrual),
44 fixedRecoveryRate_(fixedRecoveryRate), defaultPaymentTime_(defaultPaymentTime),
45 independentPayments_(independentPayments), contingentPayments_(contingentPayments),
46 defaultPayments_(defaultPayments), recoveryPayments_(recoveryPayments) {}
47
48 void fromXML(XMLNode* node) override;
49 XMLNode* toXML(ore::data::XMLDocument& doc) const override;
50
51 void build(const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory) override;
52
53 QuantLib::Real notional() const override;
54
55private:
56 std::string creditCurveId_;
59 QuantExt::CreditDefaultSwap::ProtectionPaymentTime defaultPaymentTime_;
60 std::vector<LegData> independentPayments_;
61 std::vector<LegData> contingentPayments_;
62 std::vector<LegData> defaultPayments_;
63 std::vector<LegData> recoveryPayments_;
64};
65
66} // namespace data
67} // namespace ore
QuantExt::CreditDefaultSwap::ProtectionPaymentTime defaultPaymentTime_
std::vector< LegData > contingentPayments_
std::vector< LegData > defaultPayments_
CreditLinkedSwap(const std::string &creditCurveId, const bool settlesAccrual, const Real fixedRecoveryRate, const QuantExt::CreditDefaultSwap::ProtectionPaymentTime &defaultPaymentTime, const std::vector< LegData > &independentPayments, const std::vector< LegData > &contingentPayments, const std::vector< LegData > &defaultPayments, const std::vector< LegData > &recoveryPayments)
std::vector< LegData > recoveryPayments_
std::vector< LegData > independentPayments_
QuantExt::CreditDefaultSwap::ProtectionPaymentTime defaultPaymentTime_
Trade base class.
Definition: trade.hpp:55
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base class for all serializable classes.
Definition: xmlutils.hpp:101
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
base trade data model and serialization