QuantLib
: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
ql
experimental
exoticoptions
twoassetcorrelationoption.hpp
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
Copyright (C) 2014 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
24
#ifndef quantlib_two_asset_correlation_option_hpp
25
#define quantlib_two_asset_correlation_option_hpp
26
27
#include <ql/instruments/multiassetoption.hpp>
28
#include <ql/instruments/payoffs.hpp>
29
30
namespace
QuantLib
{
31
32
class
TwoAssetCorrelationOption
:
public
MultiAssetOption
{
33
public
:
34
class
arguments
;
35
class
engine
;
36
TwoAssetCorrelationOption
(
Option::Type
type,
37
Real
strike1,
38
Real
strike2,
39
const
ext::shared_ptr<Exercise>&);
40
void
setupArguments
(
PricingEngine::arguments
*)
const override
;
41
42
protected
:
43
Real
X2_
;
44
};
45
46
class
TwoAssetCorrelationOption::arguments
47
:
public
MultiAssetOption::arguments
{
48
public
:
49
arguments
() :
X2
(
Null
<
Real
>()) {}
50
void
validate
()
const override
{
51
MultiAssetOption::arguments::validate();
52
QL_REQUIRE(
X2
!=
Null<Real>
(),
"no X2 given"
);
53
}
54
Real
X2
;
55
};
56
57
class
TwoAssetCorrelationOption::engine
58
:
public
GenericEngine
<TwoAssetCorrelationOption::arguments,
59
TwoAssetCorrelationOption::results> {};
60
61
}
62
63
64
#endif
QuantLib::GenericEngine
template base class for option pricing engines
Definition:
pricingengine.hpp:64
QuantLib::MultiAssetOption
Base class for options on multiple assets.
Definition:
multiassetoption.hpp:34
QuantLib::Null
template class providing a null value for a given type.
Definition:
null.hpp:76
QuantLib::Option::arguments
basic option arguments
Definition:
option.hpp:57
QuantLib::Option::Type
Type
Definition:
option.hpp:39
QuantLib::PricingEngine::arguments
Definition:
pricingengine.hpp:45
QuantLib::TwoAssetCorrelationOption::arguments
Definition:
twoassetcorrelationoption.hpp:47
QuantLib::TwoAssetCorrelationOption::arguments::arguments
arguments()
Definition:
twoassetcorrelationoption.hpp:49
QuantLib::TwoAssetCorrelationOption::arguments::X2
Real X2
Definition:
twoassetcorrelationoption.hpp:54
QuantLib::TwoAssetCorrelationOption::arguments::validate
void validate() const override
Definition:
twoassetcorrelationoption.hpp:50
QuantLib::TwoAssetCorrelationOption::engine
Definition:
twoassetcorrelationoption.hpp:59
QuantLib::TwoAssetCorrelationOption
Definition:
twoassetcorrelationoption.hpp:32
QuantLib::TwoAssetCorrelationOption::setupArguments
void setupArguments(PricingEngine::arguments *) const override
Definition:
twoassetcorrelationoption.cpp:33
QuantLib::TwoAssetCorrelationOption::X2_
Real X2_
Definition:
twoassetcorrelationoption.hpp:43
QuantLib::Real
QL_REAL Real
real number
Definition:
types.hpp:50
QuantLib
Definition:
any.hpp:35
Generated by
Doxygen
1.9.5