Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
equityfxlegdata.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 ored/portfolio/equityfxlegdata.hpp
20 \brief leg data for equityfx leg types
21 \ingroup portfolio
22*/
23
24#pragma once
25
27
28namespace ore {
29namespace data {
30
31using std::string;
32using std::vector;
33
34//! Serializable Equity Margin Leg Data
35/*!
36\ingroup tradedata
37*/
39public:
40 //! Default constructor
42 //! Constructor
43 EquityMarginLegData(QuantLib::ext::shared_ptr<ore::data::EquityLegData>& equityLegData, const vector<double>& rates,
44 const vector<string>& rateDates = vector<string>(), const double& initialMarginFactor = QuantExt::Null<double>(),
45 const double& multiplier = QuantExt::Null<double>())
48
49 //! \name Inspectors
50 //@{
51 const QuantLib::ext::shared_ptr<ore::data::EquityLegData> equityLegData() { return equityLegData_; }
52 const vector<double>& rates() const { return rates_; }
53 const vector<string>& rateDates() const { return rateDates_; }
54 const double& initialMarginFactor() const { return initialMarginFactor_; }
55 const double& multiplier() const { return multiplier_; }
56 //@}
57
58 //! \name Serialisation
59 //@{
60 virtual void fromXML(ore::data::XMLNode* node) override;
61 virtual ore::data::XMLNode* toXML(ore::data::XMLDocument& doc) const override;
62 //@}
63private:
64
65 QuantLib::ext::shared_ptr<ore::data::EquityLegData> equityLegData_;
66 vector<double> rates_;
67 vector<string> rateDates_;
70
71};
72
73//! \name Utilities for building QuantLib Legs
74//@{
75QuantExt::Leg makeEquityMarginLeg(const ore::data::LegData& data,
76 const QuantLib::ext::shared_ptr<QuantExt::EquityIndex2>& equityCurve,
77 const QuantLib::ext::shared_ptr<QuantExt::FxIndex>& fxIndex = nullptr,
78 const QuantLib::Date& openEndDateReplacement = QuantLib::Null<QuantLib::Date>());
79//@}
80
81} // namespace data
82} // namespace ore
Serializable Equity Margin Leg Data.
const vector< double > & rates() const
virtual void fromXML(ore::data::XMLNode *node) override
QuantLib::ext::shared_ptr< ore::data::EquityLegData > equityLegData_
EquityMarginLegData(QuantLib::ext::shared_ptr< ore::data::EquityLegData > &equityLegData, const vector< double > &rates, const vector< string > &rateDates=vector< string >(), const double &initialMarginFactor=QuantExt::Null< double >(), const double &multiplier=QuantExt::Null< double >())
Constructor.
const QuantLib::ext::shared_ptr< ore::data::EquityLegData > equityLegData()
EquityMarginLegData()
Default constructor.
const double & initialMarginFactor() const
virtual ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
const double & multiplier() const
const vector< string > & rateDates() const
Serializable Additional Leg Data.
Definition: legdata.hpp:63
Serializable object holding leg data.
Definition: legdata.hpp:844
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
leg data model and serialization
@ data
Definition: log.hpp:77
QuantExt::Leg makeEquityMarginLeg(const LegData &data, const QuantLib::ext::shared_ptr< EquityIndex2 > &equityCurve, const QuantLib::ext::shared_ptr< QuantExt::FxIndex > &fxIndex, const QuantLib::Date &openEndDateReplacement)
Serializable Credit Default Swap.
Definition: namespaces.docs:23