41 if (settlement ==
Date())
44 return bond.
notional(settlement)!=0.0;
47 Leg::const_reverse_iterator
50 if (settlement ==
Date())
59 if (settlement ==
Date())
68 if (settlement ==
Date())
77 if (settlement ==
Date())
86 if (settlement ==
Date())
95 if (settlement ==
Date())
104 if (settlement ==
Date())
113 if (settlement ==
Date())
122 if (settlement ==
Date())
126 "non tradable at " << settlement <<
135 if (settlement ==
Date())
139 "non tradable at " << settlement <<
148 if (settlement ==
Date())
152 "non tradable at " << settlement <<
161 if (settlement ==
Date())
165 "non tradable at " << settlement <<
174 if (settlement ==
Date())
178 "non tradable at " << settlement <<
187 if (settlement ==
Date())
191 "non tradable at " << settlement <<
200 if (settlement ==
Date())
204 "non tradable at " << settlement <<
213 if (settlement ==
Date())
217 "non tradable at " << settlement <<
226 if (settlement ==
Date())
242 if (settlement ==
Date())
251 if (settlement ==
Date())
255 "non tradable at " << settlement <<
256 " settlement date (maturity being " <<
268 if (settlement ==
Date())
272 "non tradable at " << settlement <<
291 if (settlement ==
Date())
295 "non tradable at " << settlement <<
309 false, settlement, settlement,
332 if (settlement ==
Date())
336 "non tradable at " << settlement <<
358 if (settlement ==
Date())
362 "non tradable at " << settlement <<
377 return bps(bond,
y, settlement);
390 return yield(bond, {price, priceType}, dayCounter, compounding, frequency,
391 settlement, accuracy, maxIterations, guess);
405 return yield<NewtonSafe>(solver, bond, price, dayCounter,
406 compounding, frequency, settlement,
414 if (settlement ==
Date())
418 "non tradable at " << settlement <<
434 return duration(bond,
y, type, settlement);
440 if (settlement ==
Date())
444 "non tradable at " << settlement <<
464 if (settlement ==
Date())
468 "non tradable at " << settlement <<
488 if (settlement ==
Date())
492 "non tradable at " << settlement <<
510 const ext::shared_ptr<YieldTermStructure>&
d,
516 if (settlement ==
Date())
523 const ext::shared_ptr<YieldTermStructure>&
d,
529 if (settlement ==
Date())
533 "non tradable at " << settlement <<
545 const ext::shared_ptr<YieldTermStructure>&
d,
554 compounding, frequency, settlement, accuracy, maxIterations, guess);
559 const ext::shared_ptr<YieldTermStructure>&
d,
567 if (settlement ==
Date())
571 "non tradable at " << settlement <<
583 dayCounter, compounding, frequency,
584 false, settlement, settlement,
585 accuracy, maxIterations, guess);
virtual Real accruedAmount(Date d=Date()) const
accrued amount at a given date
const Leg & cashflows() const
Date maturityDate() const
virtual Real notional(Date d=Date()) const
Date settlementDate(Date d=Date()) const
static Date::serial_type accruedDays(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
static Real previousCashFlowAmount(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
static Rate previousCouponRate(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
static Rate nextCouponRate(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
static Date referencePeriodStart(const Leg &leg, bool includeSettlementDateFlows, Date settlDate=Date())
static Real nextCashFlowAmount(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
static Real yieldValueBasisPoint(const Leg &leg, const InterestRate &yield, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
Yield value of a basis point.
static Real accruedAmount(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
static Real basisPointValue(const Leg &leg, const InterestRate &yield, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
Basis-point value.
static Leg::const_iterator nextCashFlow(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
the first cashflow paying after the given date
static Spread zSpread(const Leg &leg, Real npv, const ext::shared_ptr< YieldTermStructure > &, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date(), Real accuracy=1.0e-10, Size maxIterations=100, Rate guess=0.0)
implied Z-spread.
static Real npv(const Leg &leg, const YieldTermStructure &discountCurve, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
NPV of the cash flows.
static Date accrualEndDate(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
static Date accrualStartDate(const Leg &leg, bool includeSettlementDateFlows, Date settlDate=Date())
static Leg::const_reverse_iterator previousCashFlow(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
the last cashflow paying before or at the given date
static Date nextCashFlowDate(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
static Time accrualPeriod(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
static Date::serial_type accrualDays(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
static Date maturityDate(const Leg &leg)
static Time duration(const Leg &leg, const InterestRate &yield, Duration::Type type, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
Cash-flow duration.
static Date startDate(const Leg &leg)
static Date previousCashFlowDate(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
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 Real bps(const Leg &leg, const YieldTermStructure &discountCurve, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
Basis-point sensitivity of the cash flows.
static Date referencePeriodEnd(const Leg &leg, bool includeSettlementDateFlows, Date settlDate=Date())
static Time accruedPeriod(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
static Real convexity(const Leg &leg, const InterestRate &yield, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
Cash-flow convexity.
std::int_fast32_t serial_type
serial number type
Concrete interest rate class.
template class providing a null value for a given type.
void setMaxEvaluations(Size evaluations)
Interest-rate term structure.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Frequency
Frequency of events.
Real Time
continuous quantity with 1-year units
Real Spread
spreads on interest rates
std::size_t Size
size of a container
Compounding
Interest rate coumpounding rule.
Safe (bracketed) Newton 1-D solver.
static Real yieldValueBasisPoint(const Bond &bond, const InterestRate &yield, Date settlementDate=Date())
static Rate yield(const Bond &bond, Real price, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, Date settlementDate=Date(), Real accuracy=1.0e-10, Size maxIterations=100, Rate guess=0.05, Bond::Price::Type priceType=Bond::Price::Clean)
static Leg::const_iterator nextCashFlow(const Bond &bond, Date refDate=Date())
static Spread zSpread(const Bond &bond, Real cleanPrice, const ext::shared_ptr< YieldTermStructure > &, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, Date settlementDate=Date(), Real accuracy=1.0e-10, Size maxIterations=100, Rate guess=0.0)
static Leg::const_reverse_iterator previousCashFlow(const Bond &bond, Date refDate=Date())
static Rate nextCouponRate(const Bond &bond, Date settlementDate=Date())
static Date startDate(const Bond &bond)
static Date referencePeriodStart(const Bond &bond, Date settlementDate=Date())
static bool isTradable(const Bond &bond, Date settlementDate=Date())
static Real bps(const Bond &bond, const YieldTermStructure &discountCurve, Date settlementDate=Date())
static Date maturityDate(const Bond &bond)
static Date::serial_type accruedDays(const Bond &bond, Date settlementDate=Date())
static Rate atmRate(const Bond &bond, const YieldTermStructure &discountCurve, Date settlementDate, Real cleanPrice)
static Real dirtyPrice(const Bond &bond, const YieldTermStructure &discountCurve, Date settlementDate=Date())
static Date previousCashFlowDate(const Bond &bond, Date refDate=Date())
static Real nextCashFlowAmount(const Bond &bond, Date refDate=Date())
static Real convexity(const Bond &bond, const InterestRate &yield, Date settlementDate=Date())
static Real basisPointValue(const Bond &bond, const InterestRate &yield, Date settlementDate=Date())
static Date::serial_type accrualDays(const Bond &bond, Date settlementDate=Date())
static Date nextCashFlowDate(const Bond &bond, Date refDate=Date())
static Date referencePeriodEnd(const Bond &bond, Date settlementDate=Date())
static Real accruedAmount(const Bond &bond, Date settlementDate=Date())
static Date accrualStartDate(const Bond &bond, Date settlementDate=Date())
static Real cleanPrice(const Bond &bond, const YieldTermStructure &discountCurve, Date settlementDate=Date())
static Rate previousCouponRate(const Bond &bond, Date settlementDate=Date())
static Date accrualEndDate(const Bond &bond, Date settlementDate=Date())
static Time duration(const Bond &bond, const InterestRate &yield, Duration::Type type=Duration::Modified, Date settlementDate=Date())
static Time accruedPeriod(const Bond &bond, Date settlementDate=Date())
static Time accrualPeriod(const Bond &bond, Date settlementDate=Date())
static Real previousCashFlowAmount(const Bond &bond, Date refDate=Date())