QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
fdhestonbarrierengine.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2008 Andreas Gaida
5 Copyright (C) 2008 Ralph Schreyer
6 Copyright (C) 2008 Klaus Spanderen
7
8 This file is part of QuantLib, a free-software/open-source library
9 for financial quantitative analysts and developers - http://quantlib.org/
10
11 QuantLib is free software: you can redistribute it and/or modify it
12 under the terms of the QuantLib license. You should have received a
13 copy of the license along with this program; if not, please email
14 <quantlib-dev@lists.sf.net>. The license is also available online at
15 <http://quantlib.org/license.shtml>.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the license for more details.
20*/
21
26#ifndef quantlib_fd_heston_barrier_engine_hpp
27#define quantlib_fd_heston_barrier_engine_hpp
28
29#include <ql/models/equity/hestonmodel.hpp>
30#include <ql/pricingengines/genericmodelengine.hpp>
31#include <ql/methods/finitedifferences/solvers/fdmhestonsolver.hpp>
32#include <ql/methods/finitedifferences/solvers/fdmbackwardsolver.hpp>
33#include <ql/termstructures/volatility/equityfx/localvoltermstructure.hpp>
34#include <ql/instruments/dividendbarrieroption.hpp>
35
36namespace QuantLib {
37
38 QL_DEPRECATED_DISABLE_WARNING
39
41
48 : public GenericModelEngine<HestonModel,
49 DividendBarrierOption::arguments,
50 DividendBarrierOption::results> {
51 QL_DEPRECATED_ENABLE_WARNING
52 public:
53 explicit FdHestonBarrierEngine(
54 const ext::shared_ptr<HestonModel>& model,
55 Size tGrid = 100,
56 Size xGrid = 100,
57 Size vGrid = 50,
58 Size dampingSteps = 0,
59 const FdmSchemeDesc& schemeDesc = FdmSchemeDesc::Hundsdorfer(),
60 ext::shared_ptr<LocalVolTermStructure> leverageFct = {},
61 Real mixingFactor = 1.0);
62
63 explicit FdHestonBarrierEngine(
64 const ext::shared_ptr<HestonModel>& model,
65 DividendSchedule dividends,
66 Size tGrid = 100,
67 Size xGrid = 100,
68 Size vGrid = 50,
69 Size dampingSteps = 0,
70 const FdmSchemeDesc& schemeDesc = FdmSchemeDesc::Hundsdorfer(),
71 ext::shared_ptr<LocalVolTermStructure> leverageFct = {},
72 Real mixingFactor = 1.0);
73
74 void calculate() const override;
75
76 private:
81 ext::shared_ptr<LocalVolTermStructure> leverageFct_;
83 };
84
85}
86
87#endif
Finite-differences Heston barrier-option engine.
ext::shared_ptr< LocalVolTermStructure > leverageFct_
Base class for some pricing engine on a particular model.
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35
std::vector< ext::shared_ptr< Dividend > > DividendSchedule
static FdmSchemeDesc Hundsdorfer()