QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
spreadblackscholesvanillaengine.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 spreadblackscholesvanillaengine.hpp
21 \brief base class for 2d spread pricing engines using the Black-Scholes model.
22*/
23
24#ifndef quantlib_spread_black_scholes_vanilla_engine_hpp
25#define quantlib_spread_black_scholes_vanilla_engine_hpp
26
29
30namespace QuantLib {
31
33 public:
35 ext::shared_ptr<GeneralizedBlackScholesProcess> process1,
36 ext::shared_ptr<GeneralizedBlackScholesProcess> process2,
37 Real correlation);
38
39 void calculate() const override;
40
41 protected:
42 virtual Real calculate(
43 Real f1, Real f2, Real strike, Option::Type optionType,
44 Real variance1, Real variance2, DiscountFactor df) const = 0;
45
46 const ext::shared_ptr<GeneralizedBlackScholesProcess> process1_;
47 const ext::shared_ptr<GeneralizedBlackScholesProcess> process2_;
48 const Real rho_;
49 };
50}
51
52#endif
Basket option on a number of assets.
Black-Scholes processes.
Basket-option engine base class
const ext::shared_ptr< GeneralizedBlackScholesProcess > process1_
virtual Real calculate(Real f1, Real f2, Real strike, Option::Type optionType, Real variance1, Real variance2, DiscountFactor df) const =0
const ext::shared_ptr< GeneralizedBlackScholesProcess > process2_
QL_REAL Real
real number
Definition: types.hpp:50
Real DiscountFactor
discount factor between dates
Definition: types.hpp:66
Definition: any.hpp:37