37 : swapIndex_(
std::move(swapIndex)), delivery_(
Settlement::Physical),
38 settlementMethod_(
Settlement::PhysicalOTC), optionTenor_(optionTenor),
40 underlyingType_(
Swap::Payer), nominal_(1.0) {}
43 const Date& fixingDate,
45 : swapIndex_(
std::move(swapIndex)), delivery_(
Settlement::Physical),
47 fixingDate_(fixingDate),
strike_(strike), underlyingType_(
Swap::Payer) {}
50 ext::shared_ptr<Swaption> swaption = *
this;
54 MakeSwaption::operator ext::shared_ptr<Swaption>()
const {
56 const Calendar& fixingCalendar = swapIndex_->fixingCalendar();
60 refDate = fixingCalendar.
adjust(refDate);
62 fixingDate_ = fixingCalendar.
advance(refDate, optionTenor_,
69 "exercise date (" << exerciseDate_ <<
") must be less "
70 "than or equal to fixing date (" << fixingDate_ <<
")");
76 ext::shared_ptr<OvernightIndexedSwapIndex> OIswap_index = ext::dynamic_pointer_cast<OvernightIndexedSwapIndex>(swapIndex_);
79 QL_REQUIRE(!swapIndex_->forwardingTermStructure().empty(),
80 "null term structure set to this instance of " <<
83 auto temp = OIswap_index->underlyingSwap(fixingDate_);
84 temp->setPricingEngine(
85 ext::make_shared<DiscountingSwapEngine>(
86 swapIndex_->exogenousDiscount()
87 ? swapIndex_->discountingTermStructure()
88 : swapIndex_->forwardingTermStructure(),
92 usedStrike = temp->fairRate();
94 auto temp = swapIndex_->underlyingSwap(fixingDate_);
95 temp->setPricingEngine(
96 ext::make_shared<DiscountingSwapEngine>(
97 swapIndex_->exogenousDiscount()
98 ? swapIndex_->discountingTermStructure()
99 : swapIndex_->forwardingTermStructure(),
103 usedStrike = temp->fairRate();
112 (ext::shared_ptr<OvernightIndexedSwap>)(
114 OIswap_index->overnightIndex(), usedStrike)
126 (ext::shared_ptr<VanillaSwap>)(
128 swapIndex_->iborIndex(), usedStrike)
129 .withEffectiveDate(swapIndex_->valueDate(fixingDate_))
130 .withFixedLegCalendar(swapIndex_->fixingCalendar())
131 .withFixedLegDayCount(swapIndex_->dayCounter())
132 .withFixedLegTenor(swapIndex_->fixedLegTenor())
133 .withFixedLegConvention(bdc)
140 ext::shared_ptr<Swaption> swaption = ext::make_shared<Swaption>(
141 underlyingSwap_,
exercise_, delivery_, settlementMethod_);
142 swaption->setPricingEngine(
engine_);
174 const ext::shared_ptr<PricingEngine>& engine) {
Cash-flow analysis functions.
ext::shared_ptr< PricingEngine > engine_
Date adjust(const Date &, BusinessDayConvention convention=Following) const
Date advance(const Date &, Integer n, TimeUnit unit, BusinessDayConvention convention=Following, bool endOfMonth=false) const
MakeOIS & withPaymentAdjustment(BusinessDayConvention convention)
MakeOIS & withType(Swap::Type type)
MakeOIS & withFixedLegDayCount(const DayCounter &dc)
MakeOIS & withFixedLegConvention(BusinessDayConvention bdc)
MakeOIS & withFixedLegTerminationDateConvention(BusinessDayConvention bdc)
MakeOIS & withPaymentCalendar(const Calendar &cal)
MakeOIS & withEffectiveDate(const Date &)
MakeOIS & withNominal(Real n)
BusinessDayConvention optionConvention_
MakeSwaption & withOptionConvention(BusinessDayConvention bdc)
MakeSwaption & withExerciseDate(const Date &)
ext::optional< bool > useIndexedCoupons_
MakeSwaption & withAtParCoupons(bool b=true)
MakeSwaption & withIndexedCoupons(const ext::optional< bool > &b=true)
MakeSwaption & withNominal(Real n)
Settlement::Type delivery_
ext::shared_ptr< PricingEngine > engine_
MakeSwaption & withSettlementMethod(Settlement::Method settlementMethod)
MakeSwaption & withPricingEngine(const ext::shared_ptr< PricingEngine > &engine)
Settlement::Method settlementMethod_
MakeSwaption & withSettlementType(Settlement::Type delivery)
Swap::Type underlyingType_
MakeSwaption(ext::shared_ptr< SwapIndex > swapIndex, const Period &optionTenor, Rate strike=Null< Rate >())
MakeSwaption & withUnderlyingType(Swap::Type type)
MakeVanillaSwap & withFixedLegTerminationDateConvention(BusinessDayConvention bdc)
MakeVanillaSwap & withIndexedCoupons(const ext::optional< bool > &b=true)
MakeVanillaSwap & withNominal(Real n)
MakeVanillaSwap & withType(Swap::Type type)
template class providing a null value for a given type.
DateProxy & evaluationDate()
the date at which pricing is to be performed.
static Settings & instance()
access to the unique instance
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Option exercise classes and payoff function.
ext::function< Real(Real)> b
BusinessDayConvention
Business Day conventions.
Helper class to instantiate overnight indexed swaps.
Helper class to instantiate standard market swaption.
Helper class to instantiate standard market swaps.
Maps optional to either the boost or std implementation.
const ParametricExercise & exercise_
global repository for run-time library settings