QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
twoassetbarrieroption.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) 2012 Master IMAFA - Polytech'Nice Sophia - Université de Nice Sophia Antipolis
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
20/*! \file twoassetbarrieroption.hpp
21 \brief Barrier option on two assets
22*/
23
24#ifndef quantlib_two_asset_barrier_option_hpp
25#define quantlib_two_asset_barrier_option_hpp
26
30
31namespace QuantLib {
32
33 class GeneralizedBlackScholesProcess;
34
35 //! %Barrier option on two assets
36 /*! The value of the first asset is compared to the strike to
37 determine the payoff, while the value of the second asset
38 is monitored to check if the barrier is hit.
39 */
41 public:
42 class arguments;
43 class engine;
45 Barrier::Type barrierType,
46 Real barrier,
47 const ext::shared_ptr<StrikedTypePayoff>& payoff,
48 const ext::shared_ptr<Exercise>& exercise);
49
50 bool isExpired() const override;
51 void setupArguments(PricingEngine::arguments*) const override;
52
53 protected:
54 // arguments
57 };
58
59
60 //! %Arguments for two-asset %barrier %option calculation
62 public:
63 arguments();
66 void validate() const override;
67 };
68
69 //! %Two-asset barrier-option %engine base class
71 : public GenericEngine<TwoAssetBarrierOption::arguments,
72 TwoAssetBarrierOption::results> {
73 protected:
74 bool triggered(Real underlying) const;
75 };
76
77}
78
79
80#endif
Barrier type.
template base class for option pricing engines
basic option arguments
Definition: option.hpp:57
base option class
Definition: option.hpp:36
ext::shared_ptr< Payoff > payoff() const
Definition: option.hpp:45
ext::shared_ptr< Exercise > exercise() const
Definition: option.hpp:46
Arguments for two-asset barrier option calculation
Two-asset barrier-option engine base class
Barrier option on two assets
void setupArguments(PricingEngine::arguments *) const override
bool isExpired() const override
returns whether the instrument might have value greater than zero.
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:37
Option on a single asset.
Payoffs for various options.