30 ext::shared_ptr<YoYInflationIndex> index,
33 const Period& observationLag)
34 : capFloorType_(capFloorType), length_(length), calendar_(
std::move(cal)),
40 ext::shared_ptr<YoYInflationCapFloor> capfloor = *
this;
44 MakeYoYInflationCapFloor::operator ext::shared_ptr<YoYInflationCapFloor>()
const {
47 if (effectiveDate_ !=
Date()) {
48 startDate = effectiveDate_;
53 startDate = spotDate+forwardStart_;
67 if (firstCapletExcluded_)
68 leg.erase(leg.begin());
71 if (asOptionlet_ && leg.size() > 1) {
73 leg.erase(leg.begin(), --end);
76 std::vector<Rate> strikeVector(1,
strike_);
80 false, nominalTermStructure_->referenceDate());
83 ext::shared_ptr<YoYInflationCapFloor> capFloor(
new
85 capFloor->setPricingEngine(
engine_);
95 const Date& effectiveDate) {
124 const ext::shared_ptr<PricingEngine>& engine) {
Cash-flow analysis functions.
ext::shared_ptr< PricingEngine > engine_
static Rate atmRate(const Leg &leg, const YieldTermStructure &discountCurve, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date(), Real npv=Null< Real >())
At-the-money rate of the cash flows.
static Date advance(const Date &d, Integer units, TimeUnit)
Shared handle to an observable.
MakeYoYInflationCapFloor & asOptionlet(bool b=true)
only get last coupon
MakeYoYInflationCapFloor & withStrike(Rate strike)
MakeYoYInflationCapFloor & withPricingEngine(const ext::shared_ptr< PricingEngine > &engine)
BusinessDayConvention roll_
MakeYoYInflationCapFloor & withFixingDays(Natural fixingDays)
Handle< YieldTermStructure > nominalTermStructure_
MakeYoYInflationCapFloor(YoYInflationCapFloor::Type capFloorType, ext::shared_ptr< YoYInflationIndex > index, const Size &length, Calendar cal, const Period &observationLag)
MakeYoYInflationCapFloor & withNominal(Real n)
MakeYoYInflationCapFloor & withForwardStart(Period forwardStart)
MakeYoYInflationCapFloor & withEffectiveDate(const Date &effectiveDate)
MakeYoYInflationCapFloor & withPaymentDayCounter(const DayCounter &)
ext::shared_ptr< PricingEngine > engine_
MakeYoYInflationCapFloor & withPaymentAdjustment(BusinessDayConvention)
MakeYoYInflationCapFloor & withAtmStrike(const Handle< YieldTermStructure > &nominalTermStructure)
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
30/360 day count convention
Base class for yoy inflation cap-like instruments.
yoyInflationLeg & withPaymentAdjustment(BusinessDayConvention)
yoyInflationLeg & withNotionals(Real notional)
yoyInflationLeg & withPaymentDayCounter(const DayCounter &)
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
ext::function< Real(Real)> b
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
std::size_t Size
size of a container
Helper class to instantiate standard yoy inflation cap/floor.
std::vector< ext::shared_ptr< CashFlow > > Leg
Sequence of cash-flows.