Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
mporcalculator.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 engine/mporcalculator.hpp
20 \brief The cube valuation calculator interface
21 \ingroup simulation
22*/
23
24#pragma once
25
27
28namespace ore {
29namespace analytics {
30
31//! MPORCalculator
32/*! Calculate NPV for default and close-out time grids
33 * Implicit assumption that MPOR-style date grid is being used
34 * Utilises NPVCalculator for actual NPV calculation
35 *
36 */
38public:
39 //! base ccy and index to write to
40 MPORCalculator(const QuantLib::ext::shared_ptr<NPVCalculator>& npvCalc, Size defaultIndex = 0, Size closeOutIndex = 1)
41 : npvCalc_(npvCalc), defaultIndex_(defaultIndex), closeOutIndex_(closeOutIndex) {}
42
43 void calculate(const QuantLib::ext::shared_ptr<Trade>& trade, Size tradeIndex,
44 const QuantLib::ext::shared_ptr<SimMarket>& simMarket, QuantLib::ext::shared_ptr<NPVCube>& outputCube,
45 QuantLib::ext::shared_ptr<NPVCube>& outputCubeNettingSet, const Date& date, Size dateIndex, Size sample,
46 bool isCloseOut = false) override;
47
48 void calculateT0(const QuantLib::ext::shared_ptr<Trade>& trade, Size tradeIndex,
49 const QuantLib::ext::shared_ptr<SimMarket>& simMarket, QuantLib::ext::shared_ptr<NPVCube>& outputCube,
50 QuantLib::ext::shared_ptr<NPVCube>& outputCubeNettingSet) override;
51
52 void init(const QuantLib::ext::shared_ptr<Portfolio>& portfolio, const QuantLib::ext::shared_ptr<SimMarket>& simMarket) override;
53 void initScenario() override;
54
55private:
56 QuantLib::ext::shared_ptr<NPVCalculator> npvCalc_;
58};
59
60} // namespace analytics
61} // namespace ore
QuantLib::ext::shared_ptr< NPVCalculator > npvCalc_
void calculateT0(const QuantLib::ext::shared_ptr< Trade > &trade, Size tradeIndex, const QuantLib::ext::shared_ptr< SimMarket > &simMarket, QuantLib::ext::shared_ptr< NPVCube > &outputCube, QuantLib::ext::shared_ptr< NPVCube > &outputCubeNettingSet) override
void init(const QuantLib::ext::shared_ptr< Portfolio > &portfolio, const QuantLib::ext::shared_ptr< SimMarket > &simMarket) override
void calculate(const QuantLib::ext::shared_ptr< Trade > &trade, Size tradeIndex, const QuantLib::ext::shared_ptr< SimMarket > &simMarket, QuantLib::ext::shared_ptr< NPVCube > &outputCube, QuantLib::ext::shared_ptr< NPVCube > &outputCubeNettingSet, const Date &date, Size dateIndex, Size sample, bool isCloseOut=false) override
MPORCalculator(const QuantLib::ext::shared_ptr< NPVCalculator > &npvCalc, Size defaultIndex=0, Size closeOutIndex=1)
base ccy and index to write to
ValuationCalculator interface.
The counterparty cube calculator interface.