QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
pathmultiassetoption.hpp
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
24#ifndef quantlib_path_multiasset_option_hpp
25#define quantlib_path_multiasset_option_hpp
26
27#include <ql/instrument.hpp>
28#include <ql/stochasticprocess.hpp>
29#include <ql/math/matrix.hpp>
30#include <ql/experimental/mcbasket/pathpayoff.hpp>
31
32namespace QuantLib {
33
36 public:
37 explicit PathMultiAssetOption(
38 const ext::shared_ptr<PricingEngine>& engine
39 = ext::shared_ptr<PricingEngine>());
40
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
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
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
Definition: any.hpp:35