QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
doublebarrieroption.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2015 Thema Consulting SA
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
24#ifndef quantlib_double_barrier_option_hpp
25#define quantlib_double_barrier_option_hpp
26
27#include <ql/instruments/oneassetoption.hpp>
28#include <ql/instruments/doublebarriertype.hpp>
29#include <ql/instruments/payoffs.hpp>
30
31namespace QuantLib {
32
33 class GeneralizedBlackScholesProcess;
34
36
41 public:
42 class arguments;
43 class engine;
45 Real barrier_lo,
46 Real barrier_hi,
47 Real rebate,
48 const ext::shared_ptr<StrikedTypePayoff>& payoff,
49 const ext::shared_ptr<Exercise>& exercise);
50 void setupArguments(PricingEngine::arguments*) const override;
55 Real price,
56 const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
57 Real accuracy = 1.0e-4,
58 Size maxEvaluations = 100,
59 Volatility minVol = 1.0e-7,
60 Volatility maxVol = 4.0) const;
61 protected:
62 // arguments
67 };
68
70 class DoubleBarrierOption::arguments : public OneAssetOption::arguments {
71 public:
72 arguments();
77 void validate() const override;
78 };
79
82 : public GenericEngine<DoubleBarrierOption::arguments,
83 DoubleBarrierOption::results> {
84 protected:
85 bool triggered(Real underlying) const;
86 };
87
88}
89
90#endif
Arguments for double barrier option calculation
Double-Barrier-option engine base class
Double Barrier option on a single asset.
void setupArguments(PricingEngine::arguments *) const override
Volatility impliedVolatility(Real price, const ext::shared_ptr< GeneralizedBlackScholesProcess > &process, Real accuracy=1.0e-4, Size maxEvaluations=100, Volatility minVol=1.0e-7, Volatility maxVol=4.0) const
template base class for option pricing engines
Base class for options on a single asset.
ext::shared_ptr< Payoff > payoff() const
Definition: option.hpp:45
ext::shared_ptr< Exercise > exercise() const
Definition: option.hpp:46
QL_REAL Real
real number
Definition: types.hpp:50
Real Volatility
volatility
Definition: types.hpp:78
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35