Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
futureoptionhelper.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2022 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 futureoptionhelper.hpp
20 \brief calibration helper for Black-Scholes options
21 \ingroup models
22*/
23
24#ifndef quantext_calibrationhelper_futureoption_hpp
25#define quantext_calibrationhelper_futureoption_hpp
26
27#include <ql/instruments/vanillaoption.hpp>
28#include <ql/models/calibrationhelper.hpp>
30
31namespace QuantExt {
32using namespace QuantLib;
33
34//! Future Option Helper
35/*! \ingroup models
36 */
38public:
40 const Period& maturity, const Calendar& calendar, const Real strike,
41 const Handle<QuantExt::PriceTermStructure> priceCurve, const Handle<Quote> volatility,
42 BlackCalibrationHelper::CalibrationErrorType errorType = BlackCalibrationHelper::RelativePriceError);
44 const Date& exerciseDate, const Real strike,
45 const Handle<QuantExt::PriceTermStructure> priceCurve, const Handle<Quote> volatility,
46 BlackCalibrationHelper::CalibrationErrorType errorType = BlackCalibrationHelper::RelativePriceError);
47 void addTimesTo(std::list<Time>&) const override {}
48 void performCalculations() const override;
49 Real modelValue() const override;
50 Real blackPrice(Real volatility) const override;
51 QuantLib::ext::shared_ptr<VanillaOption> option() const { return option_; }
52 Real strike() const {
53 calculate();
54 return effStrike_;
55 }
56 const Handle<QuantExt::PriceTermStructure>& priceCurve() const { return priceCurve_; }
57
58private:
59 Handle<QuantExt::PriceTermStructure> priceCurve_;
60 const bool hasMaturity_;
61 Period maturity_;
62 mutable Date exerciseDate_;
63 Calendar calendar_;
64 const Real strike_;
65 mutable Real tau_;
66 mutable Real atm_;
67 mutable Option::Type type_;
68 mutable QuantLib::ext::shared_ptr<VanillaOption> option_;
69 mutable Real effStrike_;
70};
71
72} // namespace QuantExt
73
74#endif
void performCalculations() const override
Handle< QuantExt::PriceTermStructure > priceCurve_
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< QuantExt::PriceTermStructure > & priceCurve() const
void addTimesTo(std::list< Time > &) const override
Term structure of prices.