Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
blackscholesmodelwrapper.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file models/blackscholesmodelwrapper.hpp
20 \brief wrapper around a vector of BS processes
21 \ingroup utilities
22*/
23
24#pragma once
25
26#include <ql/processes/blackscholesprocess.hpp>
27#include <ql/timegrid.hpp>
28
29namespace QuantExt {
30
31using namespace QuantLib;
32
33/* this class acts as an intermediate class between the black scholes model builder and the black scholes script model;
34 the motivation to have a builder and this wrapper at all is to filter notifications from the vol surfaces and curves
35 so that a recalculations only happens when relevant market data has changed */
37public:
39 BlackScholesModelWrapper(const std::vector<QuantLib::ext::shared_ptr<GeneralizedBlackScholesProcess>>& processes,
40 const std::set<Date>& effectiveSimulationDates, const TimeGrid& discretisationTimeGrid)
43
44 const std::vector<QuantLib::ext::shared_ptr<GeneralizedBlackScholesProcess>>& processes() const { return processes_; }
45 const std::set<Date>& effectiveSimulationDates() const { return effectiveSimulationDates_; }
46 const TimeGrid& discretisationTimeGrid() const { return discretisationTimeGrid_; }
47
48private:
49 void update() override { notifyObservers(); }
50 const std::vector<QuantLib::ext::shared_ptr<GeneralizedBlackScholesProcess>> processes_;
51 const std::set<Date> effectiveSimulationDates_;
53};
54
55} // namespace QuantExt
const std::vector< QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > > & processes() const
BlackScholesModelWrapper(const std::vector< QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > > &processes, const std::set< Date > &effectiveSimulationDates, const TimeGrid &discretisationTimeGrid)
const std::set< Date > & effectiveSimulationDates() const
const std::vector< QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > > processes_