Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
commodityvolcurveconfig.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2018 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/commodityvolcurveconfig.hpp
20 \brief Commodity volatility curve configuration
21 \ingroup configuration
22*/
23
24#pragma once
25
26#include <ql/shared_ptr.hpp>
31
32namespace ore {
33namespace data {
34
35//! Commodity volatility configuration
36/*! \ingroup configuration
37 */
39public:
40 //! Default constructor
42
43 //! Explicit constructor
44 CommodityVolatilityConfig(const std::string& curveId, const std::string& curveDescription,
45 const std::string& currency,
46 const std::vector<QuantLib::ext::shared_ptr<VolatilityConfig>>& volatilityConfig,
47 const std::string& dayCounter = "A365", const std::string& calendar = "NullCalendar",
48 const std::string& futureConventionsId = "", QuantLib::Natural optionExpiryRollDays = 0,
49 const std::string& priceCurveId = "", const std::string& yieldCurveId = "",
50 const std::string& quoteSuffix = "",
52 const boost::optional<bool>& preferOutOfTheMoney = boost::none);
53
54 //! \name Inspectors
55 //@{
56 const std::string& currency() const;
57 const std::vector<QuantLib::ext::shared_ptr<VolatilityConfig>>& volatilityConfig() const;
58 const std::string& dayCounter() const;
59 const std::string& calendar() const;
60 const std::string& futureConventionsId() const;
61 QuantLib::Natural optionExpiryRollDays() const;
62 const std::string& priceCurveId() const;
63 const std::string& yieldCurveId() const;
64 const std::string& quoteSuffix() const;
66 const boost::optional<bool>& preferOutOfTheMoney() const;
67 const ReportConfig& reportConfig() const { return reportConfig_; }
68 //@}
69
70 //! \name Serialisation
71 //@{
72 void fromXML(XMLNode* node) override;
74 //@}
75
76private:
78
79 std::string currency_;
80 std::vector<QuantLib::ext::shared_ptr<VolatilityConfig>> volatilityConfig_;
81 std::string dayCounter_;
82 std::string calendar_;
84 QuantLib::Natural optionExpiryRollDays_;
85 std::string priceCurveId_;
86 std::string yieldCurveId_;
87 std::string quoteSuffix_;
89 boost::optional<bool> preferOutOfTheMoney_;
91
92 //! Populate CurveConfig::quotes_ with the required quotes.
93 void populateQuotes();
94
95 // Return a default solver configuration. Used by solverConfig() if solverConfig_ is empty.
97};
98
99} // namespace data
100} // namespace ore
Commodity volatility configuration.
void populateQuotes()
Populate CurveConfig::quotes_ with the required quotes.
const std::vector< QuantLib::ext::shared_ptr< VolatilityConfig > > & volatilityConfig() const
const std::string & futureConventionsId() const
std::vector< QuantLib::ext::shared_ptr< VolatilityConfig > > volatilityConfig_
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
const boost::optional< bool > & preferOutOfTheMoney() const
static OneDimSolverConfig defaultSolverConfig()
Base curve configuration.
Definition: curveconfig.hpp:41
const string & curveDescription() const
Definition: curveconfig.hpp:55
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
Class for holding 1-D solver configuration.
md report and arbitrage check configuration