Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
fxvolcurveconfig.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 Quaternion Risk Management Ltd
3 Copyright (C) 2024 Skandinaviska Enskilda Banken AB (publ)
4 All rights reserved.
5
6 This file is part of ORE, a free-software/open-source library
7 for transparent pricing and risk analysis - http://opensourcerisk.org
8
9 ORE is free software: you can redistribute it and/or modify it
10 under the terms of the Modified BSD License. You should have received a
11 copy of the license along with this program.
12 The license is also available online at <http://opensourcerisk.org>
13
14 This program is distributed on the basis that it will form a useful
15 contribution to risk analytics and model standardisation, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20/*! \file ored/configuration/fxvolcurveconfig.hpp
21 \brief FX volatility curve configuration classes
22 \ingroup configuration
23*/
24
25#pragma once
26
29
30#include <ql/time/calendars/target.hpp>
31#include <ql/time/daycounters/actual365fixed.hpp>
32#include <ql/time/period.hpp>
33#include <ql/types.hpp>
34
35namespace ore {
36namespace data {
39using QuantLib::DayCounter;
40using QuantLib::Period;
41using std::string;
42using std::vector;
43
44//! FX volatility structure configuration
45/*!
46 \ingroup configuration
47*/
49public:
50 //! supported volatility structure types
51 /*! For ATM we will only load ATM quotes, for Smile we load ATM, RR, BF or Deltas
52 * SmileInterpolation - currently supports which of the 2 Vanna Volga approximations,
53 * as per Castagna& Mercurio(2006), to use. The second approximation is more accurate
54 * but can ask for the square root of a negative number under unusual circumstances.
55 */
57 enum class SmileInterpolation {
60 Linear,
61 Cubic
62 }; // Vanna Volga first/second approximation respectively
63
64 //! \name Constructors/Destructors
65 //@{
66 //! Default constructor
68 //! Detailed constructor
69 FXVolatilityCurveConfig(const string& curveID, const string& curveDescription, const Dimension& dimension,
70 const vector<string>& expiries, const vector<string>& deltas = vector<string>(),
71 const string& fxSpotID = "", const string& fxForeignCurveID = "",
72 const string& fxDomesticCurveID = "",
73 const DayCounter& dayCounter = QuantLib::Actual365Fixed(),
74 const Calendar& calendar = QuantLib::TARGET(),
76 const string& conventionsID = "", const std::vector<Size>& smileDelta = {25},
77 const string& smileExtrapolation = "Flat");
78
79 FXVolatilityCurveConfig(const string& curveID, const string& curveDescription, const Dimension& dimension,
80 const string& baseVolatility1, const string& baseVolatility2,
81 const string& fxIndexTag = "GENERIC");
82
83 //@}
84
85 //! \name Serialisation
86 //@{
87 void fromXML(XMLNode* node) override;
88 XMLNode* toXML(XMLDocument& doc) const override;
89 //@}
90
91 //! \name Inspectors
92 //@{
93 const Dimension& dimension() const { return dimension_; }
94 const vector<string>& expiries() const { return expiries_; }
95 const vector<string>& deltas() const { return deltas_; }
96 const DayCounter& dayCounter() const { return dayCounter_; }
97 const Calendar& calendar() const { return calendar_; }
98 // only required for Smile
99 const string& fxSpotID() const { return fxSpotID_; }
100 const string& fxForeignYieldCurveID() const { return fxForeignYieldCurveID_; }
101 const string& fxDomesticYieldCurveID() const { return fxDomesticYieldCurveID_; }
103 const std::string& smileExtrapolation() const { return smileExtrapolation_; }
104 const string& conventionsID() const { return conventionsID_; }
105 const std::vector<Size>& smileDelta() const { return smileDelta_; }
106 const vector<string>& quotes() override;
107 const string& baseVolatility1() const { return baseVolatility1_; }
108 const string& baseVolatility2() const { return baseVolatility2_; }
109 const string& fxIndexTag() const { return fxIndexTag_; }
110 const ReportConfig& reportConfig() const { return reportConfig_; }
111 //@}
112
113 //! \name Setters
114 //@{
118 vector<string>& deltas() { return deltas_; }
119 DayCounter& dayCounter() { return dayCounter_; }
120 Calendar& calendar() { return calendar_; }
121 string& fxSpotID() { return fxSpotID_; }
124 string conventionsID() { return conventionsID_; }
125 std::vector<Size>& smileDelta() { return smileDelta_; }
126 const std::set<string>& requiredYieldCurveIDs() const { return requiredYieldCurveIDs_; };
127 string& baseVolatility1() { return baseVolatility1_; }
128 string& baseVolatility2() { return baseVolatility2_; }
129 string& fxIndexTag() { return fxIndexTag_; }
130 //@}
131
132private:
134
136 vector<string> expiries_;
137 vector<string> deltas_;
138 DayCounter dayCounter_;
139 Calendar calendar_;
140 string fxSpotID_;
144 std::vector<Size> smileDelta_;
145 std::set<string> requiredYieldCurveIDs_;
152};
153} // namespace data
154} // 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
FX volatility structure configuration.
const string & fxDomesticYieldCurveID() const
const string & baseVolatility2() const
const DayCounter & dayCounter() const
const Calendar & calendar() const
SmileInterpolation & smileInterpolation()
void fromXML(XMLNode *node) override
const string & baseVolatility1() const
XMLNode * toXML(XMLDocument &doc) const override
const vector< string > & quotes() override
Return all the market quotes required for this config.
FXVolatilityCurveConfig()
Default constructor.
const vector< string > & expiries() const
const std::set< string > & requiredYieldCurveIDs() const
const std::string & smileExtrapolation() const
const string & fxForeignYieldCurveID() const
const Dimension & dimension() const
const ReportConfig & reportConfig() const
const SmileInterpolation & smileInterpolation() const
const std::vector< Size > & smileDelta() const
const vector< string > & deltas() const
Dimension
supported volatility structure types
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
md report and arbitrage check configuration