27#ifndef quantlib_bond_functions_hpp
28#define quantlib_bond_functions_hpp
30#include <ql/cashflows/cashflows.hpp>
31#include <ql/cashflows/duration.hpp>
32#include <ql/cashflow.hpp>
33#include <ql/interestrate.hpp>
34#include <ql/instruments/bond.hpp>
35#include <ql/shared_ptr.hpp>
42 class YieldTermStructure;
65 static Leg::const_reverse_iterator
155 Real accuracy = 1.0e-10,
156 Size maxIterations = 100,
159 template <
typename Solver>
167 Real accuracy = 1.0e-10,
170 if (settlementDate ==
Date())
174 "non tradable at " << settlementDate <<
184 return CashFlows::yield<Solver>(solver, bond.
cashflows(),
186 frequency,
false, settlementDate,
187 settlementDate, accuracy, guess);
232 const ext::shared_ptr<YieldTermStructure>& discount,
240 const ext::shared_ptr<YieldTermStructure>&,
245 Real accuracy = 1.0e-10,
246 Size maxIterations = 100,
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
std::int_fast32_t serial_type
serial number type
Concrete interest rate class.
template class providing a null value for a given type.
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.
Bond adapters of CashFlows functions.
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 Rate yield(const Solver &solver, const Bond &bond, Real price, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, Date settlementDate=Date(), Real accuracy=1.0e-10, Rate guess=0.05, Bond::Price::Type priceType=Bond::Price::Clean)
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())