QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
pathmultiassetoption.cpp
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
24#include <ql/event.hpp>
25
26namespace QuantLib {
27
29 const ext::shared_ptr<PricingEngine>& engine) {
30 if (engine != nullptr)
32 }
33
36 }
37
39 NPV_ = 0.0;
40 }
41
43 const {
44 auto* arguments = dynamic_cast<PathMultiAssetOption::arguments*>(args);
45
46 QL_REQUIRE(arguments != nullptr, "wrong argument type");
47
50 }
51
53 QL_REQUIRE(payoff, "no payoff given");
54 QL_REQUIRE(!fixingDates.empty(), "no dates given");
55 }
56}
57
Black constant volatility, no time dependence, no strike dependence.
Brent 1-D solver.
virtual bool hasOccurred(const Date &refDate=Date(), ext::optional< bool > includeRefDate=ext::nullopt) const
returns true if an event has already occurred before a date
Definition: event.cpp:28
void setPricingEngine(const ext::shared_ptr< PricingEngine > &)
set the pricing engine to be used.
Definition: instrument.cpp:35
Arguments for multi-asset option calculation
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
PathMultiAssetOption(const ext::shared_ptr< PricingEngine > &engine=ext::shared_ptr< PricingEngine >())
virtual ext::shared_ptr< PathPayoff > pathPayoff() const =0
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Definition: errors.hpp:117
Base class for events associated with a given date.
Definition: any.hpp:35
Option on multiple assets.
Array of correlated 1-D stochastic processes.