36 const Date& startDate,
37 const Date& issueDate)
57 const Date& startDate,
58 const Date& issueDate)
64 std::vector<
Rate>(1, fixedRate),
71 const Date& startDate,
72 const Date& issueDate)
78 std::vector<
Rate>(1, fixedRate),
85 Size maxEvaluations)
const {
88 accuracy, maxEvaluations);
93 const std::vector<Real>& outstandings,
95 : btps_(btps), outstandings_(outstandings), quotes_(
std::move(cleanPriceQuotes)) {
101 "mismatch between number of BTPs (" << k <<
102 ") and number of outstandings (" <<
105 "mismatch between number of BTPs (" << k <<
106 ") and number of clean prices quotes (" <<
110 for (
Size i=0; i<k; ++i) {
113 " bond, maturity " <<
btps[i]->maturityDate());
119 QL_REQUIRE(!
btps_.empty(),
"invalid bonds only in RendistatoCalculator Basket");
127 for (
Size i=0; i<
n_; ++i) {
135 ext::shared_ptr<Euribor> euriborIndex,
137 : basket_(
std::move(basket)), euriborIndex_(
std::move(euriborIndex)),
139 durations_(basket_->size()),
141 swaps_(nSwaps_), swapLengths_(nSwaps_), swapBondDurations_(nSwaps_,
Null<
Time>()),
142 swapBondYields_(nSwaps_, 0.05), swapRates_(nSwaps_,
Null<
Rate>()) {
147 Rate dummyRate = 0.05;
158 const std::vector<ext::shared_ptr<BTP> >& btps =
basket_->btps();
159 const std::vector<Handle<Quote> >& quotes =
basket_->cleanPriceQuotes();
160 Date bondSettlementDate = btps[0]->settlementDate();
182 swaps_[0]->fixedSchedule(),
201 swaps_[i]->fixedSchedule(),
224 ext::shared_ptr<RendistatoCalculator>
r)
225 : r_(
std::move(
r)) {}
237 ext::shared_ptr<RendistatoCalculator>
r)
238 : r_(
std::move(
r)) {}
Italian BTP (Buoni Poliennali del Tesoro) fixed rate bond.
const YieldTermStructure & discountCurve_
Actual/360 day count convention.
Rate yield(Real cleanPrice, Date settlementDate=Date(), Real accuracy=1.0e-8, Size maxEvaluations=100) const
BTP yield given a (clean) price and settlement date.
BTP(const Date &maturityDate, Rate fixedRate, const Date &startDate=Date(), const Date &issueDate=Date())
Real cleanPrice() const
theoretical clean price
Rate yield(const DayCounter &dc, Compounding comp, Frequency freq, Real accuracy=1.0e-8, Size maxEvaluations=100, Real guess=0.05, Bond::Price::Type priceType=Bond::Price::Clean) const
theoretical bond yield
Date settlementDate(Date d=Date()) const
CCTEU(const Date &maturityDate, Spread spread, const Handle< YieldTermStructure > &fwdCurve=Handle< YieldTermStructure >(), const Date &startDate=Date(), const Date &issueDate=Date())
floating-rate bond (possibly capped and/or floored)
Shared handle to an observable.
MakeVanillaSwap & withDiscountingTermStructure(const Handle< YieldTermStructure > &discountCurve)
Calendar for reproducing theoretical calculations.
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
const std::vector< ext::shared_ptr< BTP > > & btps() const
const std::vector< Real > & outstandings() const
std::vector< ext::shared_ptr< BTP > > btps_
std::vector< Real > weights_
std::vector< Real > outstandings_
RendistatoBasket(const std::vector< ext::shared_ptr< BTP > > &btps, const std::vector< Real > &outstandings, std::vector< Handle< Quote > > cleanPriceQuotes)
std::vector< Handle< Quote > > quotes_
Size equivalentSwapIndex_
void performCalculations() const override
Handle< YieldTermStructure > discountCurve_
std::vector< Time > swapBondDurations_
ext::shared_ptr< Euribor > euriborIndex_
std::vector< Time > swapLengths_
std::vector< Rate > swapBondYields_
std::vector< ext::shared_ptr< VanillaSwap > > swaps_
std::vector< Time > durations_
RendistatoCalculator(ext::shared_ptr< RendistatoBasket > basket, ext::shared_ptr< Euribor > euriborIndex, Handle< YieldTermStructure > discountCurve)
std::vector< Rate > yields_
std::vector< Rate > swapRates_
ext::shared_ptr< RendistatoBasket > basket_
RendistatoEquivalentSwapLengthQuote(ext::shared_ptr< RendistatoCalculator > r)
Real value() const override
returns the current value
bool isValid() const override
returns true if the Quote holds a valid value
RendistatoEquivalentSwapSpreadQuote(ext::shared_ptr< RendistatoCalculator > r)
Real value() const override
returns the current value
bool isValid() const override
returns true if the Quote holds a valid value
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
detail::ordinal_holder ordinal(Size)
outputs naturals as 1st, 2nd, 3rd...
Real Time
continuous quantity with 1-year units
unsigned QL_INTEGER Natural
positive integer
Real Spread
spreads on interest rates
std::size_t Size
size of a container
Helper class to instantiate standard market swaps.
Calendar for reproducing theoretical calculations.
ext::shared_ptr< YieldTermStructure > r
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 Time duration(const Bond &bond, const InterestRate &yield, Duration::Type type=Duration::Modified, Date settlementDate=Date())