Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
staticcreditxvacalculator.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 orea/aggregation/staticcreditxvacalculator.hpp
20 \brief XVA calculator with static credit
21 \ingroup analytics
22*/
23
24#pragma once
25
27
28namespace ore {
29namespace analytics {
30using namespace QuantLib;
31using namespace QuantExt;
32using namespace data;
33using namespace std;
34
35//! XVA Calculator base with static credit
36/*!
37 XVA is calculated using survival probability from market
38*/
40public:
42 //! Driving portfolio consistent with the cube below
43 const QuantLib::ext::shared_ptr<Portfolio> portfolio,
44 //! Today's market
45 const QuantLib::ext::shared_ptr<Market> market,
46 //! Market configuration to be used
47 const string& configuration,
48 //! Base currency amounts will be converted to
49 const string& baseCurrency,
50 //! Own party name for DVA calculations
51 const string& dvaName,
52 //! FVA borrowing curve
53 const string& fvaBorrowingCurve,
54 //! FVA lending curve
55 const string& fvaLendingCurve,
56 //! Deactivate initial margin calculation even if active at netting set level
57 const bool applyDynamicInitialMargin,
58 //! Dynamic Initial Margin calculator
59 const QuantLib::ext::shared_ptr<DynamicInitialMarginCalculator> dimCalculator,
60 //! Storage ofdefault NPVs, close-out NPVs, cash flows at trade level
61 const QuantLib::ext::shared_ptr<NPVCube> tradeExposureCube,
62 //! Storage of sensitivity vectors at netting set level
63 const QuantLib::ext::shared_ptr<NPVCube> nettingSetExposureCube,
64 //! Index of the trade EPE storage in the internal exposure cube
65 const Size tradeEpeIndex = 0,
66 //! Index of the trade ENE storage in the internal exposure cube
67 const Size tradeEneIndex = 1,
68 //! Index of the netting set EPE storage in the internal exposure cube
69 const Size nettingSetEpeIndex = 1,
70 //! Index of the netting set ENE storage in the internal exposure cube
71 const Size nettingSetEneIndex = 2,
72 //! Flag to indicate flipped xva calculation
73 const bool flipViewXVA = false,
74 //! Postfix for flipView borrowing curve for fva
75 const string& flipViewBorrowingCurvePostfix = "_BORROW",
76 //! Postfix for flipView lending curve for fva
77 const string& flipViewLendingCurvePostfix = "_LEND");
78
79 virtual const Real calculateCvaIncrement(const string& tid, const string& cid,
80 const Date& d0, const Date& d1, const Real& rr) override;
81 virtual const Real calculateDvaIncrement(const string& tid,
82 const Date& d0, const Date& d1, const Real& rr) override;
83 virtual const Real calculateNettingSetCvaIncrement(
84 const string& nid, const string& cid, const Date& d0, const Date& d1, const Real& rr) override;
85 virtual const Real calculateNettingSetDvaIncrement(
86 const string& nid, const Date& d0, const Date& d1, const Real& rr) override;
87 virtual const Real calculateFbaIncrement(const string& tid, const string& cid, const string& dvaName,
88 const Date& d0, const Date& d1, const Real& dcf) override;
89 virtual const Real calculateFcaIncrement(const string& tid, const string& cid, const string& dvaName,
90 const Date& d0, const Date& d1, const Real& dcf) override;
91 virtual const Real calculateNettingSetFbaIncrement(const string& nid, const string& cid, const string& dvaName,
92 const Date& d0, const Date& d1, const Real& dcf) override;
93 virtual const Real calculateNettingSetFcaIncrement(const string& nid, const string& cid, const string& dvaName,
94 const Date& d0, const Date& d1, const Real& dcf) override;
95 virtual const Real calculateNettingSetMvaIncrement(const string& nid, const string& cid,
96 const Date& d0, const Date& d1, const Real& dcf) override;
97
98protected:
99 map<Date, Size> dateIndexMap_; // cache for performance
100};
101
102} // namespace analytics
103} // namespace ore
XVA Calculator base with static credit.
virtual const Real calculateNettingSetDvaIncrement(const string &nid, const Date &d0, const Date &d1, const Real &rr) override
virtual const Real calculateNettingSetFcaIncrement(const string &nid, const string &cid, const string &dvaName, const Date &d0, const Date &d1, const Real &dcf) override
virtual const Real calculateFbaIncrement(const string &tid, const string &cid, const string &dvaName, const Date &d0, const Date &d1, const Real &dcf) override
virtual const Real calculateNettingSetMvaIncrement(const string &nid, const string &cid, const Date &d0, const Date &d1, const Real &dcf) override
virtual const Real calculateCvaIncrement(const string &tid, const string &cid, const Date &d0, const Date &d1, const Real &rr) override
virtual const Real calculateDvaIncrement(const string &tid, const Date &d0, const Date &d1, const Real &rr) override
virtual const Real calculateNettingSetCvaIncrement(const string &nid, const string &cid, const Date &d0, const Date &d1, const Real &rr) override
virtual const Real calculateNettingSetFbaIncrement(const string &nid, const string &cid, const string &dvaName, const Date &d0, const Date &d1, const Real &dcf) override
virtual const Real calculateFcaIncrement(const string &tid, const string &cid, const string &dvaName, const Date &d0, const Date &d1, const Real &dcf) override
data
CVA calculator base class.