Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
fxvolcurve.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/marketdata/fxvolcurve.hpp
20 \brief Wrapper class for building FX volatility structures
21 \ingroup curves
22*/
23
24#pragma once
25
34#include <ql/termstructures/volatility/equityfx/blackvoltermstructure.hpp>
35
36namespace ore {
37namespace data {
39using QuantLib::BlackVolTermStructure;
40using QuantLib::Date;
41
42//! Wrapper class for building FX volatility structures
43/*!
44 \ingroup curves
45*/
47public:
48 //! \name Constructors
49 //@{
50 //! Default constructor
52 //! Detailed constructor
54 const ore::data::FXTriangulation& fxSpots,
55 const std::map<string, QuantLib::ext::shared_ptr<YieldCurve>>& yieldCurves,
56 const std::map<string, QuantLib::ext::shared_ptr<FXVolCurve>>& fxVols,
57 const map<string, QuantLib::ext::shared_ptr<CorrelationCurve>>& correlationCurves,
58 const bool buildCalibrationInfo);
59 //@}
60
61 //! \name Inspectors
62 //@{
63 const FXVolatilityCurveSpec& spec() const { return spec_; }
64 const QuantLib::ext::shared_ptr<BlackVolTermStructure>& volTermStructure() { return vol_; }
65 QuantLib::ext::shared_ptr<FxEqCommVolCalibrationInfo> calibrationInfo() const { return calibrationInfo_; }
66 //@}
67private:
69 QuantLib::ext::shared_ptr<BlackVolTermStructure> vol_;
70 Handle<Quote> fxSpot_;
71 Handle<YieldTermStructure> domYts_, forYts_;
73 std::vector<string> expiriesNoDuplicates_;
74 std::vector<Period> expiries_;
75 boost::optional<Wildcard> expiriesWildcard_;
77 Calendar spotCalendar_;
78 QuantLib::Period switchTenor_;
79 QuantLib::DeltaVolQuote::AtmType atmType_;
80 QuantLib::DeltaVolQuote::DeltaType deltaType_;
81 QuantLib::DeltaVolQuote::AtmType longTermAtmType_;
82 QuantLib::DeltaVolQuote::DeltaType longTermDeltaType_;
83 QuantLib::Option::Type riskReversalInFavorOf_;
85
86 QuantLib::ext::shared_ptr<FxEqCommVolCalibrationInfo> calibrationInfo_;
87
88 void init(Date asof, FXVolatilityCurveSpec spec, const Loader& loader, const CurveConfigurations& curveConfigs,
89 const FXTriangulation& fxSpots, const map<string, QuantLib::ext::shared_ptr<YieldCurve>>& yieldCurves,
90 const std::map<string, QuantLib::ext::shared_ptr<FXVolCurve>>& fxVols,
91 const map<string, QuantLib::ext::shared_ptr<CorrelationCurve>>& correlationCurves,
92 const bool buildCalibrationInfo);
93
94 void buildATMTriangulated(Date asof, FXVolatilityCurveSpec spec, const Loader& loader,
95 QuantLib::ext::shared_ptr<FXVolatilityCurveConfig> config, const FXTriangulation& fxSpots,
96 const map<string, QuantLib::ext::shared_ptr<YieldCurve>>& yieldCurves,
97 const std::map<std::string, QuantLib::ext::shared_ptr<FXVolCurve>>& fxVols,
98 const map<string, QuantLib::ext::shared_ptr<CorrelationCurve>>& correlationCurves);
99
100 void buildSmileDeltaCurve(Date asof, FXVolatilityCurveSpec spec, const Loader& loader,
101 QuantLib::ext::shared_ptr<FXVolatilityCurveConfig> config, const FXTriangulation& fxSpots,
102 const map<string, QuantLib::ext::shared_ptr<YieldCurve>>& yieldCurves);
103
104 void buildSmileBfRrCurve(Date asof, FXVolatilityCurveSpec spec, const Loader& loader,
105 QuantLib::ext::shared_ptr<FXVolatilityCurveConfig> config, const FXTriangulation& fxSpots,
106 const map<string, QuantLib::ext::shared_ptr<YieldCurve>>& yieldCurves);
107
108 void buildVannaVolgaOrATMCurve(Date asof, FXVolatilityCurveSpec spec, const Loader& loader,
109 QuantLib::ext::shared_ptr<FXVolatilityCurveConfig> config, const FXTriangulation& fxSpots,
110 const map<string, QuantLib::ext::shared_ptr<YieldCurve>>& yieldCurves);
111
112 void buildSmileAbsoluteCurve(Date asof, FXVolatilityCurveSpec spec, const Loader& loader,
113 QuantLib::ext::shared_ptr<FXVolatilityCurveConfig> config, const FXTriangulation& fxSpots,
114 const map<string, QuantLib::ext::shared_ptr<YieldCurve>>& yieldCurves);
115
116};
117} // namespace data
118} // namespace ore
Container class for all Curve Configurations.
Wrapper class for building FX volatility structures.
Definition: fxvolcurve.hpp:46
void buildVannaVolgaOrATMCurve(Date asof, FXVolatilityCurveSpec spec, const Loader &loader, QuantLib::ext::shared_ptr< FXVolatilityCurveConfig > config, const FXTriangulation &fxSpots, const map< string, QuantLib::ext::shared_ptr< YieldCurve > > &yieldCurves)
Definition: fxvolcurve.cpp:393
const QuantLib::ext::shared_ptr< BlackVolTermStructure > & volTermStructure()
Definition: fxvolcurve.hpp:64
QuantLib::DeltaVolQuote::AtmType atmType_
Definition: fxvolcurve.hpp:79
QuantLib::ext::shared_ptr< FxEqCommVolCalibrationInfo > calibrationInfo() const
Definition: fxvolcurve.hpp:65
void buildSmileDeltaCurve(Date asof, FXVolatilityCurveSpec spec, const Loader &loader, QuantLib::ext::shared_ptr< FXVolatilityCurveConfig > config, const FXTriangulation &fxSpots, const map< string, QuantLib::ext::shared_ptr< YieldCurve > > &yieldCurves)
Definition: fxvolcurve.cpp:72
boost::optional< Wildcard > expiriesWildcard_
Definition: fxvolcurve.hpp:75
QuantLib::Period switchTenor_
Definition: fxvolcurve.hpp:78
QuantLib::DeltaVolQuote::DeltaType longTermDeltaType_
Definition: fxvolcurve.hpp:82
QuantLib::ext::shared_ptr< FxEqCommVolCalibrationInfo > calibrationInfo_
Definition: fxvolcurve.hpp:86
FXVolCurve()
Default constructor.
Definition: fxvolcurve.hpp:51
QuantLib::DeltaVolQuote::AtmType longTermAtmType_
Definition: fxvolcurve.hpp:81
void buildSmileAbsoluteCurve(Date asof, FXVolatilityCurveSpec spec, const Loader &loader, QuantLib::ext::shared_ptr< FXVolatilityCurveConfig > config, const FXTriangulation &fxSpots, const map< string, QuantLib::ext::shared_ptr< YieldCurve > > &yieldCurves)
Definition: fxvolcurve.cpp:547
void buildATMTriangulated(Date asof, FXVolatilityCurveSpec spec, const Loader &loader, QuantLib::ext::shared_ptr< FXVolatilityCurveConfig > config, const FXTriangulation &fxSpots, const map< string, QuantLib::ext::shared_ptr< YieldCurve > > &yieldCurves, const std::map< std::string, QuantLib::ext::shared_ptr< FXVolCurve > > &fxVols, const map< string, QuantLib::ext::shared_ptr< CorrelationCurve > > &correlationCurves)
Definition: fxvolcurve.cpp:720
QuantLib::DeltaVolQuote::DeltaType deltaType_
Definition: fxvolcurve.hpp:80
QuantLib::ext::shared_ptr< BlackVolTermStructure > vol_
Definition: fxvolcurve.hpp:69
void init(Date asof, FXVolatilityCurveSpec spec, const Loader &loader, const CurveConfigurations &curveConfigs, const FXTriangulation &fxSpots, const map< string, QuantLib::ext::shared_ptr< YieldCurve > > &yieldCurves, const std::map< string, QuantLib::ext::shared_ptr< FXVolCurve > > &fxVols, const map< string, QuantLib::ext::shared_ptr< CorrelationCurve > > &correlationCurves, const bool buildCalibrationInfo)
Definition: fxvolcurve.cpp:800
Handle< Quote > fxSpot_
Definition: fxvolcurve.hpp:70
void buildSmileBfRrCurve(Date asof, FXVolatilityCurveSpec spec, const Loader &loader, QuantLib::ext::shared_ptr< FXVolatilityCurveConfig > config, const FXTriangulation &fxSpots, const map< string, QuantLib::ext::shared_ptr< YieldCurve > > &yieldCurves)
Definition: fxvolcurve.cpp:249
std::vector< string > expiriesNoDuplicates_
Definition: fxvolcurve.hpp:73
std::vector< Period > expiries_
Definition: fxvolcurve.hpp:74
Handle< YieldTermStructure > forYts_
Definition: fxvolcurve.hpp:71
Handle< YieldTermStructure > domYts_
Definition: fxvolcurve.hpp:71
FXVolatilityCurveSpec spec_
Definition: fxvolcurve.hpp:68
const FXVolatilityCurveSpec & spec() const
Definition: fxvolcurve.hpp:63
QuantLib::Option::Type riskReversalInFavorOf_
Definition: fxvolcurve.hpp:83
FX Volatility curve description.
Definition: curvespec.hpp:288
Market data loader base class.
Definition: loader.hpp:47
Currency and instrument specific conventions/defaults.
Curve configuration repository.
Curve requirements specification.
Intelligent FX price repository.
Market Datum Loader Interface.
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
vector< string > curveConfigs
utilities for wildcard handling
Wrapper class for QuantLib term structures.