Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
pnlexplainanalytic.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2024 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 orea/app/pnlexplainanalytic.hpp
20 \brief ORE Analytics Manager
21*/
22
23#pragma once
24
25#include <orea/app/analytic.hpp>
29
30namespace ore {
31namespace analytics {
32
34public:
35 static constexpr const char* LABEL = "PNL_EXPLAIN";
36 static constexpr const char* sensiLookupKey = "SENSI";
37 static constexpr const char* pnlLookupKey = "PNL";
38 PnlExplainAnalyticImpl(const QuantLib::ext::shared_ptr<InputParameters>& inputs)
39 : Analytic::Impl(inputs) {
41
42 auto sensiAnalytic = AnalyticFactory::instance().build("SENSITIVITY", inputs_);
43 if (sensiAnalytic.second)
44 addDependentAnalytic(sensiLookupKey, sensiAnalytic.second);
45
46 auto pnlAnalytic = AnalyticFactory::instance().build("PNL", inputs_);
47 if (pnlAnalytic.second)
48 addDependentAnalytic(pnlLookupKey, pnlAnalytic.second);
49 }
50
51 virtual void runAnalytic(const QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>& loader,
52 const std::set<std::string>& runTypes = {}) override;
53 virtual void setUpConfigurations() override;
54};
55
57public:
58 PnlExplainAnalytic(const QuantLib::ext::shared_ptr<InputParameters>& inputs)
59 : Analytic(std::make_unique<PnlExplainAnalyticImpl>(inputs), {"PNL_EXPLAIN"}, inputs, true, true) {
60
61 }
62};
63
64} // namespace analytics
65} // namespace ore
ORE Analytics Manager.
void setLabel(const string &label)
Definition: analytic.hpp:189
void addDependentAnalytic(const std::string &key, const QuantLib::ext::shared_ptr< Analytic > &analytic)
Definition: analytic.hpp:209
QuantLib::ext::shared_ptr< InputParameters > inputs_
Definition: analytic.hpp:216
const QuantLib::ext::shared_ptr< InputParameters > & inputs() const
Definition: analytic.hpp:116
PnlExplainAnalytic(const QuantLib::ext::shared_ptr< InputParameters > &inputs)
static constexpr const char * sensiLookupKey
virtual void runAnalytic(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const std::set< std::string > &runTypes={}) override
PnlExplainAnalyticImpl(const QuantLib::ext::shared_ptr< InputParameters > &inputs)
static constexpr const char * LABEL
static constexpr const char * pnlLookupKey
ORE NPV Lagged Analytic.