QuantLib
: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
ql
pricingengines
swap
cvaswapengine.hpp
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
Copyright (C) 2015 Jose Aparicio
5
6
This file is part of QuantLib, a free-software/open-source library
7
for financial quantitative analysts and developers - http://quantlib.org/
8
9
QuantLib is free software: you can redistribute it and/or modify it
10
under the terms of the QuantLib license. You should have received a
11
copy of the license along with this program; if not, please email
12
<quantlib-dev@lists.sf.net>. The license is also available online at
13
<http://quantlib.org/license.shtml>.
14
15
This program is distributed in the hope that it will be useful, but WITHOUT
16
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17
FOR A PARTICULAR PURPOSE. See the license for more details.
18
*/
19
20
#ifndef quantlib_cva_swap_engine_hpp
21
#define quantlib_cva_swap_engine_hpp
22
23
#include <ql/handle.hpp>
24
#include <ql/instruments/vanillaswap.hpp>
25
#include <ql/termstructures/defaulttermstructure.hpp>
26
27
namespace
QuantLib
{
28
29
class
YieldTermStructure;
30
class
Quote;
31
49
class
CounterpartyAdjSwapEngine
:
public
VanillaSwap::engine
{
50
public
:
52
53
65
CounterpartyAdjSwapEngine
(
66
const
Handle<YieldTermStructure>
& discountCurve,
67
const
Handle<PricingEngine>
& swaptionEngine,
68
const
Handle<DefaultProbabilityTermStructure>
& ctptyDTS,
69
Real
ctptyRecoveryRate,
70
const
Handle<DefaultProbabilityTermStructure>
& invstDTS =
71
Handle<DefaultProbabilityTermStructure>
(),
72
Real
invstRecoveryRate = 0.999);
84
CounterpartyAdjSwapEngine
(
const
Handle<YieldTermStructure>
& discountCurve,
85
Volatility
blackVol,
86
const
Handle<DefaultProbabilityTermStructure>
& ctptyDTS,
87
Real
ctptyRecoveryRate,
88
const
Handle<DefaultProbabilityTermStructure>
& invstDTS =
89
Handle<DefaultProbabilityTermStructure>
(),
90
Real
invstRecoveryRate = 0.999);
102
CounterpartyAdjSwapEngine
(
103
const
Handle<YieldTermStructure>
& discountCurve,
104
const
Handle<Quote>
& blackVol,
105
const
Handle<DefaultProbabilityTermStructure>
& ctptyDTS,
106
Real
ctptyRecoveryRate,
107
const
Handle<DefaultProbabilityTermStructure>
& invstDTS =
108
Handle<DefaultProbabilityTermStructure>
(),
109
Real
invstRecoveryRate = 0.999);
111
void
calculate
()
const override
;
112
113
private
:
114
Handle<PricingEngine>
baseSwapEngine_
;
115
Handle<PricingEngine>
swaptionletEngine_
;
116
Handle<YieldTermStructure>
discountCurve_
;
117
Handle<DefaultProbabilityTermStructure>
defaultTS_
;
118
Real
ctptyRecoveryRate_
;
119
Handle<DefaultProbabilityTermStructure>
invstDTS_
;
120
Real
invstRecoveryRate_
;
121
};
122
123
}
124
125
#endif
QuantLib::CounterpartyAdjSwapEngine
Definition:
cvaswapengine.hpp:49
QuantLib::CounterpartyAdjSwapEngine::discountCurve_
Handle< YieldTermStructure > discountCurve_
Definition:
cvaswapengine.hpp:116
QuantLib::CounterpartyAdjSwapEngine::swaptionletEngine_
Handle< PricingEngine > swaptionletEngine_
Definition:
cvaswapengine.hpp:115
QuantLib::CounterpartyAdjSwapEngine::ctptyRecoveryRate_
Real ctptyRecoveryRate_
Definition:
cvaswapengine.hpp:118
QuantLib::CounterpartyAdjSwapEngine::invstDTS_
Handle< DefaultProbabilityTermStructure > invstDTS_
Definition:
cvaswapengine.hpp:119
QuantLib::CounterpartyAdjSwapEngine::baseSwapEngine_
Handle< PricingEngine > baseSwapEngine_
Definition:
cvaswapengine.hpp:114
QuantLib::CounterpartyAdjSwapEngine::calculate
void calculate() const override
Definition:
cvaswapengine.cpp:108
QuantLib::CounterpartyAdjSwapEngine::defaultTS_
Handle< DefaultProbabilityTermStructure > defaultTS_
Definition:
cvaswapengine.hpp:117
QuantLib::CounterpartyAdjSwapEngine::invstRecoveryRate_
Real invstRecoveryRate_
Definition:
cvaswapengine.hpp:120
QuantLib::FixedVsFloatingSwap::engine
Definition:
fixedvsfloatingswap.hpp:162
QuantLib::Handle
Shared handle to an observable.
Definition:
handle.hpp:41
QuantLib::Real
QL_REAL Real
real number
Definition:
types.hpp:50
QuantLib::Volatility
Real Volatility
volatility
Definition:
types.hpp:78
QuantLib
Definition:
any.hpp:35
Generated by
Doxygen
1.9.5