21#include <ql/exercise.hpp>
22#include <ql/experimental/credit/blackcdsoptionengine.hpp>
23#include <ql/pricingengines/blackformula.hpp>
24#include <ql/quote.hpp>
25#include <ql/termstructures/yieldtermstructure.hpp>
34 : probability_(
std::move(probability)), recoveryRate_(recoveryRate),
35 termStructure_(
std::move(termStructure)), volatility_(
std::move(volatility)) {
46 QL_REQUIRE(maturityDate > exerciseDate,
47 "Underlying CDS should start after option maturity");
69 stdDev, riskyAnnuity);
73 Real frontEndProtection =
78 results_.value += frontEndProtection;
Handle< Quote > volatility()
Handle< Quote > volatility_
BlackCdsOptionEngine(Handle< DefaultProbabilityTermStructure >, Real recoveryRate, Handle< YieldTermStructure > termStructure, Handle< Quote > vol)
Handle< DefaultProbabilityTermStructure > probability_
void calculate() const override
Handle< YieldTermStructure > termStructure_
Handle< YieldTermStructure > termStructure()
ext::shared_ptr< CreditDefaultSwap > swap
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
CdsOption::results results_
CdsOption::arguments arguments_
Shared handle to an observable.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
ext::shared_ptr< Exercise > exercise
Real Time
continuous quantity with 1-year units
QL_INTEGER Integer
integer number
Real blackFormula(Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount, Real displacement)