Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
analyticoutperformanceoptionengine.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 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/pricingengines/analyticoutperformanceoptionengine.hpp
20 \brief Analytic European engine for outperformance options
21*/
22
23#ifndef quantext_analytic_outperformance_option_engine_hpp
24#define quantext_analytic_outperformance_option_engine_hpp
25
27#include <ql/processes/blackscholesprocess.hpp>
29
30namespace QuantExt {
31using namespace QuantLib;
32
33//! Pricing engine for European outperformance options using analytical formulae
34
36public:
37 AnalyticOutperformanceOptionEngine( const ext::shared_ptr<GeneralizedBlackScholesProcess>& process1,
38 const ext::shared_ptr<GeneralizedBlackScholesProcess>& process2,
39 const Handle<CorrelationTermStructure>& correlation, QuantLib::Size integrationPoints);
40 void calculate() const override;
41
42private:
43 Real correlation(Time t, Real strike = 1) const { return correlationCurve_->correlation(t, strike); }
44 Real rho(Time t) const { return std::max(std::min(correlation(t), 0.9999), -0.9999); }
45 Real integrand(const Real x, Real phi, Real k, Real m1, Real m2, Real v1, Real v2, Real s1, Real s2, Real i1, Real i2, Real fixingTime) const;
46 Real getTodaysFxConversionRate(const QuantLib::ext::shared_ptr<QuantExt::FxIndex>& fxIndex) const;
47
48 class integrand_f;
49 friend class integrand_f;
50
51 ext::shared_ptr<GeneralizedBlackScholesProcess> process1_;
52 ext::shared_ptr<GeneralizedBlackScholesProcess> process2_;
53
54 Handle<CorrelationTermStructure> correlationCurve_;
55 QuantLib::Size integrationPoints_;
56};
57} // namespace QuantExt
58
59#endif
Pricing engine for European outperformance options using analytical formulae.
ext::shared_ptr< GeneralizedBlackScholesProcess > process2_
Real getTodaysFxConversionRate(const QuantLib::ext::shared_ptr< QuantExt::FxIndex > &fxIndex) const
ext::shared_ptr< GeneralizedBlackScholesProcess > process1_
Real integrand(const Real x, Real phi, Real k, Real m1, Real m2, Real v1, Real v2, Real s1, Real s2, Real i1, Real i2, Real fixingTime) const
base class for outperformance option engines
Term structure of correlations.