Index CDS option instrument.
More...
#include <qle/instruments/indexcdsoption.hpp>
Index CDS option instrument.
Definition at line 35 of file indexcdsoption.hpp.
◆ IndexCdsOption()
IndexCdsOption |
( |
const QuantLib::ext::shared_ptr< IndexCreditDefaultSwap > & |
swap, |
|
|
const QuantLib::ext::shared_ptr< QuantLib::Exercise > & |
exercise, |
|
|
QuantLib::Real |
strike, |
|
|
CdsOption::StrikeType |
strikeType_ = CdsOption::Spread , |
|
|
Settlement::Type |
settlementType = Settlement::Cash , |
|
|
QuantLib::Real |
tradeDateNtl = QuantLib::Null<QuantLib::Real>() , |
|
|
QuantLib::Real |
realisedFep = QuantLib::Null<QuantLib::Real>() , |
|
|
const QuantLib::Period & |
indexTerm = 5 * Years |
|
) |
| |
Definition at line 68 of file indexcdsoption.cpp.
72 : Option(QuantLib::ext::make_shared<NullPayoff>(), exercise),
swap_(swap),
strike_(strike),
strikeType_(strikeType),
76}
CdsOption::StrikeType strikeType_
QuantLib::ext::shared_ptr< IndexCreditDefaultSwap > swap_
QuantLib::Real realisedFep_
QuantLib::Real riskyAnnuity_
Settlement::Type settlementType_
QuantLib::Real tradeDateNtl_
QuantLib::Period indexTerm_
◆ isExpired()
Definition at line 78 of file indexcdsoption.cpp.
78{ return detail::simple_event(exercise_->dates().back()).hasOccurred(); }
◆ setupArguments()
Definition at line 85 of file indexcdsoption.cpp.
85 {
86 swap_->setupArguments(args);
87 Option::setupArguments(args);
88
89 IndexCdsOption::arguments* arguments = dynamic_cast<IndexCdsOption::arguments*>(args);
90
91 QL_REQUIRE(arguments != 0, "wrong argument type");
92
93 arguments->swap =
swap_;
100}
◆ underlyingSwap()
◆ atmRate()
◆ riskyAnnuity()
Real riskyAnnuity |
( |
| ) |
const |
◆ impliedVolatility()
Volatility impliedVolatility |
( |
QuantLib::Real |
price, |
|
|
const QuantLib::Handle< QuantLib::YieldTermStructure > & |
termStructureSwapCurrency, |
|
|
const QuantLib::Handle< QuantLib::YieldTermStructure > & |
termStructureTradeCollateral, |
|
|
const QuantLib::Handle< QuantLib::DefaultProbabilityTermStructure > & |
, |
|
|
QuantLib::Real |
recoveryRate, |
|
|
QuantLib::Real |
accuracy = 1.e-4 , |
|
|
QuantLib::Size |
maxEvaluations = 100 , |
|
|
QuantLib::Volatility |
minVol = 1.0e-7 , |
|
|
QuantLib::Volatility |
maxVol = 4.0 |
|
) |
| const |
Definition at line 117 of file indexcdsoption.cpp.
122 {
123 calculate();
124 QL_REQUIRE(!
isExpired(),
"instrument expired");
125
126 Volatility guess = 0.10;
127
128 ImpliedVolHelper f(*this, probability, recoveryRate, termStructureSwapCurrency, termStructureTradeCollateral,
129 targetValue);
130 Brent solver;
131 solver.setMaxEvaluations(maxEvaluations);
132 return solver.solve(f, accuracy, guess, minVol, maxVol);
133}
bool isExpired() const override
◆ setupExpired()
void setupExpired |
( |
| ) |
const |
|
overrideprivate |
◆ fetchResults()
void fetchResults |
( |
const QuantLib::PricingEngine::results * |
results | ) |
const |
|
overrideprivate |
Definition at line 102 of file indexcdsoption.cpp.
102 {
103 Option::fetchResults(r);
104 const IndexCdsOption::results* results = dynamic_cast<const IndexCdsOption::results*>(r);
105 QL_ENSURE(results != 0, "wrong results type");
107}
◆ swap_
◆ strike_
◆ strikeType_
◆ settlementType_
Settlement::Type settlementType_ |
|
private |
◆ tradeDateNtl_
QuantLib::Real tradeDateNtl_ |
|
private |
◆ realisedFep_
QuantLib::Real realisedFep_ |
|
private |
◆ indexTerm_
QuantLib::Period indexTerm_ |
|
private |
◆ riskyAnnuity_
QuantLib::Real riskyAnnuity_ |
|
mutableprivate |