QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
ql
pricingengines
basket
bjerksundstenslandspreadengine.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) 2024 Klaus Spanderen
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 bjerksundstenslandspreadengine.hpp
21
\brief Bjerksund and Stensland formulae (2006)
22
*/
23
24
#ifndef quantlib_bjerksund_stensland_spread_engine_hpp
25
#define quantlib_bjerksund_stensland_spread_engine_hpp
26
27
#include <
ql/pricingengines/basket/spreadblackscholesvanillaengine.hpp
>
28
29
namespace
QuantLib
{
30
31
//! Pricing engine for spread option on two futures
32
/*! P. Bjerksund and G. Stensland,
33
Closed form spread option valuation,
34
Quantitative Finance, 14 (2014), pp. 1785–1794.
35
36
\ingroup basketengines
37
*/
38
class
BjerksundStenslandSpreadEngine
:
public
SpreadBlackScholesVanillaEngine
{
39
public
:
40
BjerksundStenslandSpreadEngine
(
41
ext::shared_ptr<GeneralizedBlackScholesProcess> process1,
42
ext::shared_ptr<GeneralizedBlackScholesProcess> process2,
43
Real
correlation);
44
45
protected
:
46
Real
calculate
(
Real
f1,
Real
f2,
Real
strike,
Option::Type
optionType,
47
Real
variance1,
Real
variance2,
DiscountFactor
df)
const override
;
48
};
49
}
50
51
52
#endif
QuantLib::BjerksundStenslandSpreadEngine
Pricing engine for spread option on two futures.
Definition:
bjerksundstenslandspreadengine.hpp:38
QuantLib::Option::Type
Type
Definition:
option.hpp:39
QuantLib::SpreadBlackScholesVanillaEngine
Definition:
spreadblackscholesvanillaengine.hpp:32
QuantLib::SpreadBlackScholesVanillaEngine::calculate
void calculate() const override
Definition:
spreadblackscholesvanillaengine.cpp:36
QuantLib::Real
QL_REAL Real
real number
Definition:
types.hpp:50
QuantLib::DiscountFactor
Real DiscountFactor
discount factor between dates
Definition:
types.hpp:66
QuantLib
Definition:
any.hpp:37
spreadblackscholesvanillaengine.hpp
base class for 2d spread pricing engines using the Black-Scholes model.
Generated by
Doxygen
1.9.5