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 <<
284 if (settlement ==
Date())
288 "non tradable at " << settlement <<
302 false, settlement, settlement,
325 if (settlement ==
Date())
329 "non tradable at " << settlement <<
351 if (settlement ==
Date())
355 "non tradable at " << settlement <<
370 return bps(bond,
y, settlement);
384 return yield<NewtonSafe>(solver, bond, price, dayCounter,
385 compounding, frequency, settlement,
393 if (settlement ==
Date())
397 "non tradable at " << settlement <<
413 return duration(bond,
y, type, settlement);
419 if (settlement ==
Date())
423 "non tradable at " << settlement <<
443 if (settlement ==
Date())
447 "non tradable at " << settlement <<
467 if (settlement ==
Date())
471 "non tradable at " << settlement <<
489 const ext::shared_ptr<YieldTermStructure>&
d,
495 if (settlement ==
Date())
502 const ext::shared_ptr<YieldTermStructure>&
d,
508 if (settlement ==
Date())
512 "non tradable at " << settlement <<
524 const ext::shared_ptr<YieldTermStructure>&
d,
532 if (settlement ==
Date())
536 "non tradable at " << settlement <<
548 dayCounter, compounding, frequency,
549 false, settlement, settlement,
550 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 Leg::const_iterator nextCashFlow(const Bond &bond, Date refDate=Date())
static Leg::const_reverse_iterator previousCashFlow(const Bond &bond, Date refDate=Date())
static Rate atmRate(const Bond &bond, const YieldTermStructure &discountCurve, Date settlementDate=Date(), Bond::Price price={})
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 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 Spread zSpread(const Bond &bond, Bond::Price price, 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 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 Rate yield(const Bond &bond, Bond::Price price, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, Date settlementDate=Date(), Real accuracy=1.0e-10, Size maxIterations=100, Rate guess=0.05)
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())