Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
equitycurveconfig.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 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/configuration/equitycurveconfig.hpp
20 \brief Equity curve configuration classes
21 \ingroup configuration
22*/
23
24#pragma once
25
28#include <ql/exercise.hpp>
29#include <ql/time/calendar.hpp>
30#include <ql/time/daycounter.hpp>
31#include <ql/time/period.hpp>
32#include <ql/types.hpp>
33
34namespace ore {
35namespace data {
37using QuantLib::BusinessDayConvention;
39using QuantLib::DayCounter;
40using QuantLib::Period;
41using std::string;
42using std::vector;
43
44//! Equity curve configuration
45/*!
46 \ingroup configuration
47*/
49public:
50 //! Supported equity curve types
52 //! \name Constructors/Destructors
53 //@{
54 //! Detailed constructor
55 EquityCurveConfig(const string& curveID, const string& curveDescription, const string& forecastingCurve,
56 const string& currency, const string& calendar, const Type& type, const string& equitySpotQuote,
57 const vector<string>& quotes, const string& dayCountID = "",
58 const string& dividendInterpVariable = "Zero", const string& dividendInterpMethod = "Linear",
59 const bool dividendExtrapolation = false, const bool extrapolation = false,
60 const QuantLib::Exercise::Type& exerciseStyle = QuantLib::Exercise::Type::European);
61 //! Default constructor
63 //@}
64
65 //! \name Serialisation
66 //@{
67 void fromXML(XMLNode* node) override;
68 XMLNode* toXML(XMLDocument& doc) const override;
69 //@}
70
71 //! \name Inspectors
72 //@{
73 const string& forecastingCurve() const { return forecastingCurve_; }
74 const string& currency() const { return parseCurrencyWithMinors(currency_).code(); }
75 const string& calendar() const { return calendar_; }
76 const Type& type() const { return type_; }
77 const string& equitySpotQuoteID() const { return equitySpotQuoteID_; }
78 const string& dayCountID() const { return dayCountID_; }
79 const string& dividendInterpolationVariable() const { return divInterpVariable_; }
80 const string& dividendInterpolationMethod() const { return divInterpMethod_; }
82 bool extrapolation() const { return extrapolation_; }
83 const QuantLib::Exercise::Type exerciseStyle() const { return exerciseStyle_; }
84 const vector<string>& fwdQuotes() { return fwdQuotes_; }
85 //@}
86
87 //! \name Setters
88 //@{
89 string& forecastingCurve() { return forecastingCurve_; }
90 Type& type() { return type_; }
92 string& dayCountID() { return dayCountID_; }
96 bool& extrapolation() { return extrapolation_; }
97 QuantLib::Exercise::Type& exerciseStyle() { return exerciseStyle_; }
98
99 void setCurrency(const string& currency) { currency_ = currency; }
100 void setCalendar(const string& calendar) { calendar_ = calendar; }
101 //@}
102
103private:
105
106 vector<string> fwdQuotes_;
108 string currency_;
109 string calendar_;
117 QuantLib::Exercise::Type exerciseStyle_;
118};
119
120std::ostream& operator<<(std::ostream& out, EquityCurveConfig::Type t);
121
123
124} // namespace data
125} // namespace ore
Base curve configuration.
Definition: curveconfig.hpp:41
const string & curveDescription() const
Definition: curveconfig.hpp:55
const string & curveID() const
Definition: curveconfig.hpp:54
virtual const vector< string > & quotes()
Return all the market quotes required for this config.
Definition: curveconfig.hpp:69
Equity curve configuration.
const string & forecastingCurve() const
const string & currency() const
Type
Supported equity curve types.
EquityCurveConfig()
Default constructor.
QuantLib::Exercise::Type exerciseStyle_
const vector< string > & fwdQuotes()
const string & equitySpotQuoteID() const
const string & dayCountID() const
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
void setCurrency(const string &currency)
const string & calendar() const
const string & dividendInterpolationVariable() const
const QuantLib::Exercise::Type exerciseStyle() const
void setCalendar(const string &calendar)
QuantLib::Exercise::Type & exerciseStyle()
const string & dividendInterpolationMethod() const
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base curve configuration classes.
Currency parseCurrencyWithMinors(const string &s)
Convert text to QuantLib::Currency.
Definition: parsers.cpp:310
@ data
Definition: log.hpp:77
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
EquityCurveConfig::Type parseEquityCurveConfigType(const std::string &str)
Serializable Credit Default Swap.
Definition: namespaces.docs:23
Map text representations to QuantLib/QuantExt types.