Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
simmarket.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 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 simulation/simmarket.hpp
20 \brief A Market class that can be Simulated
21 \ingroup simulation
22*/
23
24#pragma once
25
30
31namespace ore {
32namespace analytics {
33using namespace ore::data;
34
35//! Simulation Market
36/*!
37 A Simulation Market is a MarketImpl which is used for pricing under scenarios.
38 It has an update method which is used to generate or retrieve a new market scenario,
39 to apply the scenario to its term structures and to notify all termstructures and
40 instruments of this change so that the instruments are recalculated with the NPV call.
41
42 \ingroup simulation
43 */
45public:
47
48 //! Generate or retrieve market scenario, update market, notify termstructures and update fixings
49 virtual void update(const Date& d) {
50 preUpdate();
51 updateDate(d);
53 postUpdate(d, true);
54 updateAsd(d);
55 }
56
57 //! Observable settings depending on selected mode, before we update the market
58 virtual void preUpdate() = 0;
59
60 //! Update to the given date
61 virtual void updateDate(const Date&) = 0;
62
63 //! Retrieve next market scenario and apply this, but don't update date
64 virtual void updateScenario(const Date&) = 0;
65
66 //! Observable reset depending on selected mode, instrument updates
67 virtual void postUpdate(const Date& d, bool withFixings) = 0;
68
69 //! Update aggregation scenario data
70 virtual void updateAsd(const Date&) = 0;
71
72 //! Return current numeraire value
73 Real numeraire() { return numeraire_; }
74
75 //! Return current scenario label, if any.
76 const std::string& label() { return label_; }
77
78 //! Reset sim market to initial state
79 virtual void reset() = 0;
80
81 //! Get the fixing manager
82 virtual const QuantLib::ext::shared_ptr<FixingManager>& fixingManager() const = 0;
83
84protected:
86 std::string label_;
87};
88} // namespace analytics
89} // namespace ore
this class holds data associated to scenarios
Simulation Market.
Definition: simmarket.hpp:44
virtual void preUpdate()=0
Observable settings depending on selected mode, before we update the market.
Real numeraire()
Return current numeraire value.
Definition: simmarket.hpp:73
virtual void updateAsd(const Date &)=0
Update aggregation scenario data.
virtual void reset()=0
Reset sim market to initial state.
virtual const QuantLib::ext::shared_ptr< FixingManager > & fixingManager() const =0
Get the fixing manager.
const std::string & label()
Return current scenario label, if any.
Definition: simmarket.hpp:76
SimMarket(const bool handlePseudoCurrencies)
Definition: simmarket.hpp:46
virtual void updateDate(const Date &)=0
Update to the given date.
virtual void update(const Date &d)
Generate or retrieve market scenario, update market, notify termstructures and update fixings.
Definition: simmarket.hpp:49
virtual void updateScenario(const Date &)=0
Retrieve next market scenario and apply this, but don't update date.
virtual void postUpdate(const Date &d, bool withFixings)=0
Observable reset depending on selected mode, instrument updates.
bool handlePseudoCurrencies() const
Controls the updating/reset of the QuantLib::IndexManager.