31#include <ql/time/date.hpp>
33#include <ql/shared_ptr.hpp>
53 const QuantLib::ext::shared_ptr<Portfolio> portfolio,
55 const QuantLib::ext::shared_ptr<Market> market,
57 const string& configuration,
59 const string& baseCurrency,
61 const string& dvaName,
63 const string& fvaBorrowingCurve,
65 const string& fvaLendingCurve,
67 const bool applyDynamicInitialMargin,
69 const QuantLib::ext::shared_ptr<DynamicInitialMarginCalculator> dimCalculator,
71 const QuantLib::ext::shared_ptr<NPVCube> tradeExposureCube,
73 const QuantLib::ext::shared_ptr<NPVCube> nettingSetExposureCube,
75 const Size tradeEpeIndex = 0,
77 const Size tradeEneIndex = 1,
79 const Size nettingSetEpeIndex = 1,
81 const Size nettingSetEneIndex = 2,
83 const bool flipViewXVA =
false,
85 const string& flipViewBorrowingCurvePostfix =
"_BORROW",
87 const string& flipViewLendingCurvePostfix =
"_LEND");
99 const Date& d0,
const Date& d1,
const Real& rr) = 0;
101 const Date& d0,
const Date& d1,
const Real& rr) = 0;
103 const string& nid,
const string& cid,
const Date& d0,
const Date& d1,
const Real& rr) = 0;
105 const string& nid,
const Date& d0,
const Date& d1,
const Real& rr) = 0;
107 const Date& d0,
const Date& d1,
const Real& dcf) = 0;
109 const Date& d0,
const Date& d1,
const Real& dcf) = 0;
111 const Date& d0,
const Date& d1,
const Real& dcf) = 0;
113 const Date& d0,
const Date& d1,
const Real& dcf) = 0;
115 const Date& d0,
const Date& d1,
const Real& dcf) = 0;
118 const map<string, Real>&
tradeCva();
121 const map<string, Real>&
tradeDva();
136 const Real&
tradeCva(
const string& trade);
139 const Real&
tradeDva(
const string& trade);
142 const Real&
tradeFba(
const string& trade);
151 const Real&
tradeFca(
const string& trade);
160 const Real&
tradeMva(
const string& trade);
XVA Calculator base class.
map< string, Real > nettingSetSumCva_
string flipViewBorrowingCurvePostfix_
const map< string, Real > & nettingSetSumDva()
Sum DVA map for all the netting sets.
const Real & tradeFca(const string &trade)
FCA for the specified trade.
map< string, Real > nettingSetSumDva_
QuantLib::ext::shared_ptr< Market > market_
const Real & tradeFca_exAllSp(const string &trade)
FCA (excl all survival probability) for the specified trade.
map< string, Real > tradeFba_exAllSp_
string fvaBorrowingCurve_
const map< string, Real > & tradeDva()
DVA map for all the trades.
map< string, Real > nettingSetCva_
map< string, Real > tradeFca_exAllSp_
virtual const Real calculateNettingSetCvaIncrement(const string &nid, const string &cid, const Date &d0, const Date &d1, const Real &rr)=0
map< string, Real > nettingSetFca_
const Real & tradeFba_exOwnSp(const string &trade)
FBA (excl own survival probability) for the specified trade.
const Real & nettingSetFba_exOwnSp(const string &nettingSet)
FBA (excl own survival probability) for the specified netting set.
virtual const Real calculateFcaIncrement(const string &tid, const string &cid, const string &dvaName, const Date &d0, const Date &d1, const Real &dcf)=0
virtual const Date asof()
const Real & tradeFba(const string &trade)
FBA for the specified trade.
virtual const Real calculateDvaIncrement(const string &tid, const Date &d0, const Date &d1, const Real &rr)=0
map< string, Real > tradeFba_exOwnSp_
map< string, Real > tradeFca_
map< string, Real > tradeDva_
virtual const Real calculateNettingSetDvaIncrement(const string &nid, const Date &d0, const Date &d1, const Real &rr)=0
map< string, Real > tradeCva_
map< string, Real > nettingSetMva_
const Real & nettingSetFba_exAllSp(const string &nettingSet)
FBA (excl all survival probability) for the specified netting set.
map< string, Real > nettingSetFca_exOwnSp_
map< string, string > nettingSetCpty_
string flipViewLendingCurvePostfix_
virtual void build()
Compute cva along all paths and fill result structures.
const Real & nettingSetFca(const string &nettingSet)
FCA for the specified netting set.
bool applyDynamicInitialMargin_
virtual const Real calculateNettingSetFcaIncrement(const string &nid, const string &cid, const string &dvaName, const Date &d0, const Date &d1, const Real &dcf)=0
virtual const Real calculateFbaIncrement(const string &tid, const string &cid, const string &dvaName, const Date &d0, const Date &d1, const Real &dcf)=0
virtual const vector< Date > & dates()
const map< string, Real > & tradeCva()
CVA map for all the trades.
const Real & nettingSetFca_exOwnSp(const string &nettingSet)
FCA (excl own survival probability) for the specified netting set.
QuantLib::ext::shared_ptr< Portfolio > portfolio_
const map< string, Real > & nettingSetDva()
DVA map for all the netting sets.
const map< string, Real > & nettingSetSumCva()
Sum CVA map for all the netting sets.
map< string, Real > nettingSetFba_exOwnSp_
const Real & tradeMva(const string &trade)
MVA for the specified trade.
map< string, Real > tradeFba_
virtual const Real calculateCvaIncrement(const string &tid, const string &cid, const Date &d0, const Date &d1, const Real &rr)=0
const Real & nettingSetFba(const string &nettingSet)
FBA for the specified netting set.
QuantLib::ext::shared_ptr< DynamicInitialMarginCalculator > dimCalculator_
map< string, Real > nettingSetFba_
virtual const Real calculateNettingSetFbaIncrement(const string &nid, const string &cid, const string &dvaName, const Date &d0, const Date &d1, const Real &dcf)=0
const QuantLib::ext::shared_ptr< NPVCube > nettingSetExposureCube_
virtual const Real calculateNettingSetMvaIncrement(const string &nid, const string &cid, const Date &d0, const Date &d1, const Real &dcf)=0
const map< string, Real > & nettingSetCva()
CVA map for all the netting sets.
const Real & nettingSetFca_exAllSp(const string &nettingSet)
FCA (excl all survival probability) for the specified netting set.
map< string, Real > nettingSetDva_
map< string, Real > nettingSetFca_exAllSp_
map< string, Real > tradeMva_
map< string, Real > nettingSetFba_exAllSp_
const Real & tradeFba_exAllSp(const string &trade)
FBA (excl all survival probability) for the specified trade.
const Real & tradeFca_exOwnSp(const string &trade)
FCA (excl own survival probability) for the specified trade.
const QuantLib::ext::shared_ptr< NPVCube > tradeExposureCube_
const Real & nettingSetMva(const string &nettingSet)
MVA for the specified netting set.
map< string, Real > tradeFca_exOwnSp_
virtual ~ValueAdjustmentCalculator()
Dynamic Initial Margin calculator base class.