Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
cdsoptionhelper.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2017 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 models/cdsoptionhelper.hpp
20 \brief cds option calibration helper
21 \ingroup models
22*/
23
24#ifndef quantext_cdsoptionhelper_hpp
25#define quantext_cdsoptionhelper_hpp
26
28#include <ql/instruments/creditdefaultswap.hpp>
29
30#include <ql/models/calibrationhelper.hpp>
31#include <ql/quotes/simplequote.hpp>
32
33namespace QuantExt {
34using namespace QuantLib;
35//! CDS option helper
36/*!
37 \ingroup models
38 */
40public:
42 const Date& exerciseDate, const Handle<Quote>& volatility, const Protection::Side side,
43 const Schedule& schedule, const BusinessDayConvention paymentConvention, const DayCounter& dayCounter,
44 const Handle<DefaultProbabilityTermStructure>& probability, const Real recoveryRate,
45 const Handle<YieldTermStructure>& termStructure, const Rate spread = Null<Rate>(),
46 const Rate upfront = Null<Rate>(), const bool settlesAccrual = true,
47 const CreditDefaultSwap::ProtectionPaymentTime proteectionPaymentTime =
48 CreditDefaultSwap::ProtectionPaymentTime::atDefault,
49 const Date protectionStart = Date(), const Date upfrontDate = Date(),
50 const QuantLib::ext::shared_ptr<Claim>& claim = QuantLib::ext::shared_ptr<Claim>(),
51 const BlackCalibrationHelper::CalibrationErrorType errorType = BlackCalibrationHelper::RelativePriceError);
52
53 virtual void addTimesTo(std::list<Time>& times) const override {}
54 virtual Real modelValue() const override;
55 virtual Real blackPrice(Volatility volatility) const override;
56
57 QuantLib::ext::shared_ptr<CreditDefaultSwap> underlying() const { return cds_; }
58 QuantLib::ext::shared_ptr<QuantExt::CdsOption> option() const { return option_; }
59
60private:
61 Handle<YieldTermStructure> termStructure_;
62 QuantLib::ext::shared_ptr<CreditDefaultSwap> cds_;
63 QuantLib::ext::shared_ptr<QuantExt::CdsOption> option_;
64 QuantLib::ext::shared_ptr<SimpleQuote> blackVol_;
65 QuantLib::ext::shared_ptr<PricingEngine> blackEngine_;
66};
67} // namespace QuantExt
68
69#endif
CDS option, removed requirements (rec must knock out, no upfront amount), that should be taken care o...
QuantLib::ext::shared_ptr< QuantExt::CdsOption > option_
QuantLib::ext::shared_ptr< CreditDefaultSwap > cds_
virtual Real blackPrice(Volatility volatility) const override
QuantLib::ext::shared_ptr< PricingEngine > blackEngine_
virtual Real modelValue() const override
QuantLib::ext::shared_ptr< SimpleQuote > blackVol_
QuantLib::ext::shared_ptr< CreditDefaultSwap > underlying() const
virtual void addTimesTo(std::list< Time > &times) const override
Handle< YieldTermStructure > termStructure_
QuantLib::ext::shared_ptr< QuantExt::CdsOption > option() const