QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
isdacdsengine.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2014 Jose Aparicio
5 Copyright (C) 2014 Peter Caspers
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
25#ifndef quantlib_isda_cds_engine_hpp
26#define quantlib_isda_cds_engine_hpp
27
28#include <ql/instruments/creditdefaultswap.hpp>
29#include <ql/termstructures/yieldtermstructure.hpp>
30#include <ql/termstructures/defaulttermstructure.hpp>
31#include <ql/optional.hpp>
32
33namespace QuantLib {
34
50
51 public:
67 None, // as in [1] footnote 26 (i.e. 10^{-50} is added to
68 // denominators $f_i+h_i$$)
69 Taylor // as in [2] i.e. for $f_i+h_i < 10^{-4}$ a Taylor expansion
70 // is used to avoid zero denominators
71 };
72
74 HalfDayBias, // as in [1] formula (50), second (error) term is
75 // included
76 NoBias // as in [1], but second term in formula (50) is not included
77 };
78
80 Flat, // as in [1], formula (52), second (error) term is included
81 Piecewise // as in [1], but second term in formula (52) is not
82 // included
83 };
84
99 Real recoveryRate,
100 Handle<YieldTermStructure> discountCurve,
101 const ext::optional<bool>& includeSettlementDateFlows = ext::nullopt,
102 NumericalFix numericalFix = Taylor,
103 AccrualBias accrualBias = HalfDayBias,
104 ForwardsInCouponPeriod forwardsInCouponPeriod = Piecewise);
105
108
109 void calculate() const override;
110
111 private:
115 const ext::optional<bool> includeSettlementDateFlows_;
119 };
120}
121
122#endif
Shared handle to an observable.
Definition: handle.hpp:41
const ext::optional< bool > includeSettlementDateFlows_
Handle< YieldTermStructure > discountCurve_
Handle< YieldTermStructure > isdaRateCurve() const
Handle< DefaultProbabilityTermStructure > isdaCreditCurve() const
Handle< DefaultProbabilityTermStructure > probability_
void calculate() const override
const ForwardsInCouponPeriod forwardsInCouponPeriod_
const NumericalFix numericalFix_
const AccrualBias accrualBias_
QL_REAL Real
real number
Definition: types.hpp:50
const boost::none_t & nullopt
Definition: optional.cpp:27
Definition: any.hpp:35