QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
pathmultiassetoption.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) 2008 Andrea Odetti
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 pathmultiassetoption.hpp
21 \brief Option on multiple assets
22*/
23
24#ifndef quantlib_path_multiasset_option_hpp
25#define quantlib_path_multiasset_option_hpp
26
27#include <ql/instrument.hpp>
29#include <ql/math/matrix.hpp>
31
32namespace QuantLib {
33
34 //! Base class for path-dependent options on multiple assets
36 public:
37 explicit PathMultiAssetOption(
38 const ext::shared_ptr<PricingEngine>& engine
39 = ext::shared_ptr<PricingEngine>());
40
41 //! \name Instrument interface
42 //@{
43 class arguments;
44 class results;
45 class engine;
46
47 bool isExpired() const override;
48
49 void setupArguments(PricingEngine::arguments*) const override;
50
51 virtual ext::shared_ptr<PathPayoff> pathPayoff() const = 0;
52 virtual std::vector<Date> fixingDates() const = 0;
53
54 protected:
55 void setupExpired() const override;
56 };
57
58 //! %Arguments for multi-asset option calculation
60 : public virtual PricingEngine::arguments {
61 public:
62 arguments() = default;
63 void validate() const override;
64
65 ext::shared_ptr<PathPayoff> payoff;
66 std::vector<Date> fixingDates;
67 };
68
69 //! %Results from multi-asset option calculation
71 public:
72 void reset() override { Instrument::results::reset(); }
73 };
74
76 : public GenericEngine<PathMultiAssetOption::arguments,
77 PathMultiAssetOption::results> {};
78
79}
80
81
82#endif
template base class for option pricing engines
Abstract instrument class.
Definition: instrument.hpp:44
Arguments for multi-asset option calculation
Results from multi-asset option calculation
Base class for path-dependent options on multiple assets.
void setupArguments(PricingEngine::arguments *) const override
bool isExpired() const override
returns whether the instrument might have value greater than zero.
virtual std::vector< Date > fixingDates() const =0
virtual ext::shared_ptr< PathPayoff > pathPayoff() const =0
Abstract instrument class.
matrix used in linear algebra.
Definition: any.hpp:35
Option payoff classes.
stochastic processes