Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
basecorrelationcurveconfig.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/*! \file ored/configuration/basecorrelationcurveconfig.hpp
20 \brief Base Correlation curve configuration classes
21 \ingroup configuration
22*/
23
24#pragma once
25
27#include <ql/time/calendar.hpp>
28#include <ql/time/dategenerationrule.hpp>
29#include <ql/time/daycounter.hpp>
30#include <ql/time/period.hpp>
31#include <ql/types.hpp>
32#include <boost/optional/optional.hpp>
33
34namespace ore {
35namespace data {
37using QuantLib::BusinessDayConvention;
39using QuantLib::DayCounter;
40using QuantLib::Natural;
41using QuantLib::Period;
42using std::string;
43using std::vector;
44
45//! Base Correlation term structure configuration
46/*!
47 \ingroup configuration
48*/
50public:
51 //! \name Constructors/Destructors
52 //@{
53 //! Default constructor
55
56 //! Detailed constructor
58 const string& curveID,
59 const string& curveDescription,
60 const vector<string>& detachmentPoints,
61 const vector<string>& terms,
62 QuantLib::Size settlementDays,
64 QuantLib::BusinessDayConvention businessDayConvention,
65 QuantLib::DayCounter dayCounter,
66 bool extrapolate,
67 const std::string& quoteName = "",
68 const QuantLib::Date& startDate = QuantLib::Date(),
69 const QuantLib::Period& indexTerm = 0 * QuantLib::Days,
70 boost::optional<QuantLib::DateGeneration::Rule> rule = boost::none,
71 bool adjustForLosses = true);
72 //@}
73
74 //! \name Serialisation
75 //@{
76 void fromXML(XMLNode* node) override;
77 XMLNode* toXML(XMLDocument& doc) const override;
78 //@}
79
80 //! \name Inspectors
81 //@{
82 const vector<string>& terms() const { return terms_; }
83 const vector<string>& detachmentPoints() const { return detachmentPoints_; }
84 const Size& settlementDays() const { return settlementDays_; }
85 const Calendar& calendar() const { return calendar_; }
86 const BusinessDayConvention& businessDayConvention() const { return businessDayConvention_; }
87 const DayCounter& dayCounter() const { return dayCounter_; }
88 const bool& extrapolate() const { return extrapolate_; }
89 const std::string& quoteName() const { return quoteName_; }
90 const QuantLib::Date& startDate() const { return startDate_; }
91 const QuantLib::Period& indexTerm() const { return indexTerm_; }
92 const boost::optional<QuantLib::DateGeneration::Rule>& rule() const { return rule_; }
93 const bool& adjustForLosses() const { return adjustForLosses_; }
94 const vector<string>& quotes() override;
95 //@}
96
97 //! \name Setters
98 //@{
99 vector<string>& terms() { return terms_; }
100 vector<string>& detachmentPoints() { return detachmentPoints_; }
101 Size& settlementDays() { return settlementDays_; }
102 Calendar& calendar() { return calendar_; }
103 BusinessDayConvention& businessDayConvention() { return businessDayConvention_; }
104 DayCounter& dayCounter() { return dayCounter_; }
105 bool& extrapolate() { return extrapolate_; }
106 QuantLib::Period& indexTerm() { return indexTerm_; }
107 //@}
108
109private:
110 vector<string> detachmentPoints_;
111 vector<string> terms_;
113 Calendar calendar_;
114 BusinessDayConvention businessDayConvention_;
115 DayCounter dayCounter_;
117 std::string quoteName_;
118 QuantLib::Date startDate_;
119 QuantLib::Period indexTerm_;
120 boost::optional<QuantLib::DateGeneration::Rule> rule_;
122};
123} // namespace data
124} // namespace ore
Base Correlation term structure configuration.
const boost::optional< QuantLib::DateGeneration::Rule > & rule() const
const QuantLib::Period & indexTerm() const
const vector< string > & detachmentPoints() const
XMLNode * toXML(XMLDocument &doc) const override
const vector< string > & quotes() override
Return all the market quotes required for this config.
BaseCorrelationCurveConfig(const string &curveID, const string &curveDescription, const vector< string > &detachmentPoints, const vector< string > &terms, QuantLib::Size settlementDays, const QuantLib::Calendar &calendar, QuantLib::BusinessDayConvention businessDayConvention, QuantLib::DayCounter dayCounter, bool extrapolate, const std::string &quoteName="", const QuantLib::Date &startDate=QuantLib::Date(), const QuantLib::Period &indexTerm=0 *QuantLib::Days, boost::optional< QuantLib::DateGeneration::Rule > rule=boost::none, bool adjustForLosses=true)
Detailed constructor.
boost::optional< QuantLib::DateGeneration::Rule > rule_
const BusinessDayConvention & businessDayConvention() const
Base curve configuration.
Definition: curveconfig.hpp:41
const string & curveDescription() const
Definition: curveconfig.hpp:55
const string & curveID() const
Definition: curveconfig.hpp:54
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base curve configuration classes.
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23