26#include <ql/math/solvers1d/newtonsafe.hpp>
27#include <ql/pricingengines/bond/bondfunctions.hpp>
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())
246 "non tradable at " << settlement <<
247 " settlement date (maturity being " <<
259 if (settlement ==
Date())
263 "non tradable at " << settlement <<
275 if (settlement ==
Date())
279 "non tradable at " << settlement <<
289 false, settlement, settlement,
312 if (settlement ==
Date())
316 "non tradable at " << settlement <<
338 if (settlement ==
Date())
342 "non tradable at " << settlement <<
357 return bps(bond, y, settlement);
372 return yield<NewtonSafe>(solver, bond, price, dayCounter,
373 compounding, frequency, settlement,
374 accuracy, guess, priceType);
381 if (settlement ==
Date())
385 "non tradable at " << settlement <<
401 return duration(bond, y, type, settlement);
407 if (settlement ==
Date())
411 "non tradable at " << settlement <<
431 if (settlement ==
Date())
435 "non tradable at " << settlement <<
456 if (settlement ==
Date())
460 "non tradable at " << settlement <<
479 const ext::shared_ptr<YieldTermStructure>& d,
485 if (settlement ==
Date())
489 "non tradable at " << settlement <<
501 const ext::shared_ptr<YieldTermStructure>& d,
509 if (settlement ==
Date())
513 "non tradable at " << settlement <<
522 dayCounter, compounding, frequency,
523 false, settlement, settlement,
524 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.
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.
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 atmRate(const Bond &bond, const YieldTermStructure &discountCurve, Date settlementDate=Date(), Real cleanPrice=Null< Real >())
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 Real dirtyPrice(const Bond &bond, const InterestRate &yield, 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())