QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
hestonmodelhelper.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2005 Klaus Spanderen
5 Copyright (C) 2015 Peter Caspers
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
21/*! \file hestonmodelhelper.hpp
22 \brief Heston-model calibration helper
23*/
24
25#ifndef quantlib_heston_option_helper_hpp
26#define quantlib_heston_option_helper_hpp
27
30
31namespace QuantLib {
32
33 //! calibration helper for Heston model
35 public:
37 Calendar calendar,
38 Real s0,
39 Real strikePrice,
41 const Handle<YieldTermStructure>& riskFreeRate,
42 const Handle<YieldTermStructure>& dividendYield,
45
47 Calendar calendar,
48 const Handle<Quote>& s0,
49 Real strikePrice,
51 const Handle<YieldTermStructure>& riskFreeRate,
52 const Handle<YieldTermStructure>& dividendYield,
55
56 void addTimesTo(std::list<Time>&) const override {}
57 void performCalculations() const override;
58 Real modelValue() const override;
59 Real blackPrice(Real volatility) const override;
60 Time maturity() const { calculate(); return tau_; }
61 private:
69 mutable Time tau_;
71 mutable ext::shared_ptr<VanillaOption> option_;
72 };
73
74}
75
76
77#endif
78
Calibration helper class.
liquid Black76 market instrument used during calibration
Handle< Quote > volatility() const
returns the volatility Handle
calendar class
Definition: calendar.hpp:61
Concrete date class.
Definition: date.hpp:125
Shared handle to an observable.
Definition: handle.hpp:41
calibration helper for Heston model
void performCalculations() const override
Real blackPrice(Real volatility) const override
Black or Bachelier price given a volatility.
Real modelValue() const override
returns the price of the instrument according to the model
const Handle< YieldTermStructure > dividendYield_
ext::shared_ptr< VanillaOption > option_
void addTimesTo(std::list< Time > &) const override
const Handle< YieldTermStructure > riskFreeRate_
virtual void calculate() const
Definition: lazyobject.hpp:253
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35
Vanilla option on a single asset.