Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
crossassetmodelimpliedfxvoltermstructure.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 qle/models/crossassetmodelimpliedfxvoltermstructure.hpp
20 \brief dynamic black volatility term structure
21 \ingroup crossassetmodel
22*/
23
24#ifndef quantext_crossassetmodel_implied_fx_volatility_termstructure_hpp
25#define quantext_crossassetmodel_implied_fx_volatility_termstructure_hpp
26
28
29#include <ql/termstructures/volatility/equityfx/blackvoltermstructure.hpp>
30
31namespace QuantExt {
32using namespace QuantLib;
33
34//! Analytic Cross Currency CC LGM FX Option Enfine
35/*! \ingroup crossassetmodel
36 */
37class AnalyticCcLgmFxOptionEngine;
38
39//! Cross Asset Model Implied FX Term Structure
40/*! The termstructure as the reference date of the model at construction,
41 you can vary this and the relevant state variables using the state() and
42 move() methods.
43
44 \ingroup crossassetmodel
45*/
46
47/* TODO probably slow, we need to introduce a cache */
48
50public:
51 CrossAssetModelImpliedFxVolTermStructure(const QuantLib::ext::shared_ptr<CrossAssetModel>& model,
52 const Size foreignCurrencyIndex, BusinessDayConvention bdc = Following,
53 const DayCounter& dc = DayCounter(), const bool purelyTimeBased = false);
54
55 void referenceDate(const Date& d);
56 void referenceTime(const Time t);
57 void state(const Real domesticIr, const Real foreignIr, const Real logFx);
58 void move(const Date& d, const Real domesticIr, const Real foreignIr, const Real logFx);
59 void move(const Time t, const Real domesticIr, const Real foreignIr, const Real logFx);
60
61 /* VolatilityTermStructure interface */
62 Real minStrike() const override;
63 Real maxStrike() const override;
64 /* TermStructure interface */
65 Date maxDate() const override;
66 Time maxTime() const override;
67 const Date& referenceDate() const override;
68 /* Observer interface */
69 void update() override;
70
71 Size fxIndex() const { return fxIndex_; }
72
73protected:
74 /* BlackVolTermStructure interface */
75 Real blackVarianceImpl(Time t, Real strike) const override;
76 Volatility blackVolImpl(Time t, Real strike) const override;
77
78private:
79 const QuantLib::ext::shared_ptr<CrossAssetModel> model_;
80 const Size fxIndex_;
81 const bool purelyTimeBased_;
82 const QuantLib::ext::shared_ptr<AnalyticCcLgmFxOptionEngine> engine_;
85};
86
87} // namespace QuantExt
88
89#endif
void state(const Real domesticIr, const Real foreignIr, const Real logFx)
const QuantLib::ext::shared_ptr< AnalyticCcLgmFxOptionEngine > engine_
void move(const Date &d, const Real domesticIr, const Real foreignIr, const Real logFx)
cross asset model