Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
fxeqoptionhelper.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 fxeqoptionhelper.hpp
20 \brief calibration helper for Black-Scholes options
21 \ingroup models
22*/
23
24#ifndef quantext_calibrationhelper_fxeqoption_hpp
25#define quantext_calibrationhelper_fxeqoption_hpp
26
27#include <ql/instruments/vanillaoption.hpp>
28#include <ql/models/calibrationhelper.hpp>
29
30namespace QuantExt {
31using namespace QuantLib;
32
33//! FxEq Option Helper
34/*! \ingroup models
35 */
37public:
38 /*! the spot is interpreted as of today (or discounted spot)
39 if strike is null, an (fwd-) atm option is constructed,
40 a slight approximation is introduced because there is no
41 settlement lag, however this applies consistently to
42 the black and the model pricing */
44 const Period& maturity, const Calendar& calendar, const Real strike, const Handle<Quote> spot,
45 const Handle<Quote> volatility, const Handle<YieldTermStructure>& domesticYield,
46 const Handle<YieldTermStructure>& foreignYield,
47 BlackCalibrationHelper::CalibrationErrorType errorType = BlackCalibrationHelper::RelativePriceError);
49 const Date& exerciseDate, const Real strike, const Handle<Quote> spot, const Handle<Quote> volatility,
50 const Handle<YieldTermStructure>& domesticYield, const Handle<YieldTermStructure>& foreignYield,
51 BlackCalibrationHelper::CalibrationErrorType errorType = BlackCalibrationHelper::RelativePriceError);
52 void addTimesTo(std::list<Time>&) const override {}
53 void performCalculations() const override;
54 Real modelValue() const override;
55 Real blackPrice(Real volatility) const override;
56 QuantLib::ext::shared_ptr<VanillaOption> option() const { return option_; }
57 Real strike() const {
58 calculate();
59 return effStrike_;
60 }
61
62private:
63 Handle<YieldTermStructure> termStructure_;
64 const bool hasMaturity_;
65 Period maturity_;
66 mutable Date exerciseDate_;
67 Calendar calendar_;
68 const Real strike_;
69 const Handle<Quote> spot_;
70 const Handle<YieldTermStructure> foreignYield_;
71 mutable Real tau_;
72 mutable Real atm_;
73 mutable Option::Type type_;
74 mutable QuantLib::ext::shared_ptr<VanillaOption> option_;
75 mutable Real effStrike_;
76};
77
78} // namespace QuantExt
79
80#endif
const Handle< Quote > spot_
void performCalculations() const override
Real blackPrice(Real volatility) const override
Real modelValue() const override
QuantLib::ext::shared_ptr< VanillaOption > option() const
QuantLib::ext::shared_ptr< VanillaOption > option_
const Handle< YieldTermStructure > foreignYield_
Handle< YieldTermStructure > termStructure_
void addTimesTo(std::list< Time > &) const override