QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
bondfunctions.cpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2009 Nathan Abbott
5 Copyright (C) 2007, 2008, 2009, 2010 Ferdinando Ametrano
6 Copyright (C) 2007 Chiara Fornarola
7 Copyright (C) 2008 Simon Ibbotson
8 Copyright (C) 2004 M-Dimension Consulting Inc.
9 Copyright (C) 2005, 2006, 2007, 2008, 2009 StatPro Italia srl
10 Copyright (C) 2004 Jeff Yu
11
12 This file is part of QuantLib, a free-software/open-source library
13 for financial quantitative analysts and developers - http://quantlib.org/
14
15 QuantLib is free software: you can redistribute it and/or modify it
16 under the terms of the QuantLib license. You should have received a
17 copy of the license along with this program; if not, please email
18 <quantlib-dev@lists.sf.net>. The license is also available online at
19 <http://quantlib.org/license.shtml>.
20
21 This program is distributed in the hope that it will be useful, but WITHOUT
22 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
23 FOR A PARTICULAR PURPOSE. See the license for more details.
24*/
25
28
29namespace QuantLib {
30
32 return CashFlows::startDate(bond.cashflows());
33 }
34
37 }
38
40 Date settlement) {
41 if (settlement == Date())
42 settlement = bond.settlementDate();
43
44 return bond.notional(settlement)!=0.0;
45 }
46
47 Leg::const_reverse_iterator
49 Date settlement) {
50 if (settlement == Date())
51 settlement = bond.settlementDate();
52
54 false, settlement);
55 }
56
57 Leg::const_iterator BondFunctions::nextCashFlow(const Bond& bond,
58 Date settlement) {
59 if (settlement == Date())
60 settlement = bond.settlementDate();
61
63 false, settlement);
64 }
65
67 Date settlement) {
68 if (settlement == Date())
69 settlement = bond.settlementDate();
70
72 false, settlement);
73 }
74
76 Date settlement) {
77 if (settlement == Date())
78 settlement = bond.settlementDate();
79
81 false, settlement);
82 }
83
85 Date settlement) {
86 if (settlement == Date())
87 settlement = bond.settlementDate();
88
90 false, settlement);
91 }
92
94 Date settlement) {
95 if (settlement == Date())
96 settlement = bond.settlementDate();
97
99 false, settlement);
100 }
101
103 Date settlement) {
104 if (settlement == Date())
105 settlement = bond.settlementDate();
106
108 false, settlement);
109 }
110
112 Date settlement) {
113 if (settlement == Date())
114 settlement = bond.settlementDate();
115
117 false, settlement);
118 }
119
121 Date settlement) {
122 if (settlement == Date())
123 settlement = bond.settlementDate();
124
125 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
126 "non tradable at " << settlement <<
127 " (maturity being " << bond.maturityDate() << ")");
128
130 false, settlement);
131 }
132
134 Date settlement) {
135 if (settlement == Date())
136 settlement = bond.settlementDate();
137
138 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
139 "non tradable at " << settlement <<
140 " (maturity being " << bond.maturityDate() << ")");
141
143 false, settlement);
144 }
145
147 Date settlement) {
148 if (settlement == Date())
149 settlement = bond.settlementDate();
150
151 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
152 "non tradable at " << settlement <<
153 " (maturity being " << bond.maturityDate() << ")");
154
156 false, settlement);
157 }
158
160 Date settlement) {
161 if (settlement == Date())
162 settlement = bond.settlementDate();
163
164 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
165 "non tradable at " << settlement <<
166 " (maturity being " << bond.maturityDate() << ")");
167
169 false, settlement);
170 }
171
173 Date settlement) {
174 if (settlement == Date())
175 settlement = bond.settlementDate();
176
177 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
178 "non tradable at " << settlement <<
179 " (maturity being " << bond.maturityDate() << ")");
180
182 false, settlement);
183 }
184
186 Date settlement) {
187 if (settlement == Date())
188 settlement = bond.settlementDate();
189
190 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
191 "non tradable at " << settlement <<
192 " (maturity being " << bond.maturityDate() << ")");
193
194 return CashFlows::accrualDays(bond.cashflows(),
195 false, settlement);
196 }
197
199 Date settlement) {
200 if (settlement == Date())
201 settlement = bond.settlementDate();
202
203 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
204 "non tradable at " << settlement <<
205 " (maturity being " << bond.maturityDate() << ")");
206
208 false, settlement);
209 }
210
212 Date settlement) {
213 if (settlement == Date())
214 settlement = bond.settlementDate();
215
216 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
217 "non tradable at " << settlement <<
218 " (maturity being " << bond.maturityDate() << ")");
219
220 return CashFlows::accruedDays(bond.cashflows(),
221 false, settlement);
222 }
223
225 Date settlement) {
226 if (settlement == Date())
227 settlement = bond.settlementDate();
228
229 if (!BondFunctions::isTradable(bond, settlement))
230 return 0.0;
231
233 false, settlement) *
234 100.0 / bond.notional(settlement);
235 }
236
237
238
240 const YieldTermStructure& discountCurve,
241 Date settlement) {
242 if (settlement == Date())
243 settlement = bond.settlementDate();
244
245 return dirtyPrice(bond, discountCurve, settlement) - bond.accruedAmount(settlement);
246 }
247
249 const YieldTermStructure& discountCurve,
250 Date settlement) {
251 if (settlement == Date())
252 settlement = bond.settlementDate();
253
254 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
255 "non tradable at " << settlement <<
256 " settlement date (maturity being " <<
257 bond.maturityDate() << ")");
258
259 Real dirtyPrice = CashFlows::npv(bond.cashflows(), discountCurve,
260 false, settlement) *
261 100.0 / bond.notional(settlement);
262 return dirtyPrice;
263 }
264
266 const YieldTermStructure& discountCurve,
267 Date settlement) {
268 if (settlement == Date())
269 settlement = bond.settlementDate();
270
271 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
272 "non tradable at " << settlement <<
273 " (maturity being " << bond.maturityDate() << ")");
274
275 return CashFlows::bps(bond.cashflows(), discountCurve,
276 false, settlement) *
277 100.0 / bond.notional(settlement);
278 }
279
281 const YieldTermStructure& discountCurve,
282 Date settlement,
283 Real cleanPrice) {
284 return atmRate(bond, discountCurve, settlement, {cleanPrice, Bond::Price::Clean});
285 }
286
288 const YieldTermStructure& discountCurve,
289 Date settlement,
290 const Bond::Price price) {
291 if (settlement == Date())
292 settlement = bond.settlementDate();
293
294 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
295 "non tradable at " << settlement <<
296 " (maturity being " << bond.maturityDate() << ")");
297
298 Real npv = Null<Real>();
299 if (price.isValid()) {
301 price.amount() +
302 (price.type() == Bond::Price::Clean ? bond.accruedAmount(settlement) : 0);
303
304 Real currentNotional = bond.notional(settlement);
305 npv = dirtyPrice / 100.0 * currentNotional;
306
307 }
308 return CashFlows::atmRate(bond.cashflows(), discountCurve,
309 false, settlement, settlement,
310 npv);
311 }
312
314 const InterestRate& yield,
315 Date settlement) {
316 return dirtyPrice(bond, yield, settlement) - bond.accruedAmount(settlement);
317 }
318
320 Rate yield,
321 const DayCounter& dayCounter,
322 Compounding compounding,
323 Frequency frequency,
324 Date settlement) {
325 InterestRate y(yield, dayCounter, compounding, frequency);
326 return cleanPrice(bond, y, settlement);
327 }
328
330 const InterestRate& yield,
331 Date settlement) {
332 if (settlement == Date())
333 settlement = bond.settlementDate();
334
335 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
336 "non tradable at " << settlement <<
337 " (maturity being " << bond.maturityDate() << ")");
338
340 false, settlement) *
341 100.0 / bond.notional(settlement);
342 return dirtyPrice;
343 }
344
346 Rate yield,
347 const DayCounter& dayCounter,
348 Compounding compounding,
349 Frequency frequency,
350 Date settlement) {
351 InterestRate y(yield, dayCounter, compounding, frequency);
352 return dirtyPrice(bond, y, settlement);
353 }
354
356 const InterestRate& yield,
357 Date settlement) {
358 if (settlement == Date())
359 settlement = bond.settlementDate();
360
361 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
362 "non tradable at " << settlement <<
363 " (maturity being " << bond.maturityDate() << ")");
364
365 return CashFlows::bps(bond.cashflows(), yield,
366 false, settlement) *
367 100.0 / bond.notional(settlement);
368 }
369
371 Rate yield,
372 const DayCounter& dayCounter,
373 Compounding compounding,
374 Frequency frequency,
375 Date settlement) {
376 InterestRate y(yield, dayCounter, compounding, frequency);
377 return bps(bond, y, settlement);
378 }
379
381 Real price,
382 const DayCounter& dayCounter,
383 Compounding compounding,
384 Frequency frequency,
385 Date settlement,
386 Real accuracy,
387 Size maxIterations,
388 Rate guess,
389 Bond::Price::Type priceType) {
390 return yield(bond, {price, priceType}, dayCounter, compounding, frequency,
391 settlement, accuracy, maxIterations, guess);
392 }
393
395 Bond::Price price,
396 const DayCounter& dayCounter,
397 Compounding compounding,
398 Frequency frequency,
399 Date settlement,
400 Real accuracy,
401 Size maxIterations,
402 Rate guess) {
403 NewtonSafe solver;
404 solver.setMaxEvaluations(maxIterations);
405 return yield<NewtonSafe>(solver, bond, price, dayCounter,
406 compounding, frequency, settlement,
407 accuracy, guess);
408 }
409
411 const InterestRate& yield,
412 Duration::Type type,
413 Date settlement) {
414 if (settlement == Date())
415 settlement = bond.settlementDate();
416
417 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
418 "non tradable at " << settlement <<
419 " (maturity being " << bond.maturityDate() << ")");
420
421 return CashFlows::duration(bond.cashflows(), yield,
422 type,
423 false, settlement);
424 }
425
427 Rate yield,
428 const DayCounter& dayCounter,
429 Compounding compounding,
430 Frequency frequency,
431 Duration::Type type,
432 Date settlement) {
433 InterestRate y(yield, dayCounter, compounding, frequency);
434 return duration(bond, y, type, settlement);
435 }
436
438 const InterestRate& yield,
439 Date settlement) {
440 if (settlement == Date())
441 settlement = bond.settlementDate();
442
443 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
444 "non tradable at " << settlement <<
445 " (maturity being " << bond.maturityDate() << ")");
446
447 return CashFlows::convexity(bond.cashflows(), yield,
448 false, settlement);
449 }
450
452 Rate yield,
453 const DayCounter& dayCounter,
454 Compounding compounding,
455 Frequency frequency,
456 Date settlement) {
457 InterestRate y(yield, dayCounter, compounding, frequency);
458 return convexity(bond, y, settlement);
459 }
460
462 const InterestRate& yield,
463 Date settlement) {
464 if (settlement == Date())
465 settlement = bond.settlementDate();
466
467 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
468 "non tradable at " << settlement <<
469 " (maturity being " << bond.maturityDate() << ")");
470
472 false, settlement);
473 }
474
476 Rate yield,
477 const DayCounter& dayCounter,
478 Compounding compounding,
479 Frequency frequency,
480 Date settlement) {
481 InterestRate y(yield, dayCounter, compounding, frequency);
482 return basisPointValue(bond, y, settlement);
483 }
484
486 const InterestRate& yield,
487 Date settlement) {
488 if (settlement == Date())
489 settlement = bond.settlementDate();
490
491 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
492 "non tradable at " << settlement <<
493 " (maturity being " << bond.maturityDate() << ")");
494
496 false, settlement);
497 }
498
500 Rate yield,
501 const DayCounter& dayCounter,
502 Compounding compounding,
503 Frequency frequency,
504 Date settlement) {
505 InterestRate y(yield, dayCounter, compounding, frequency);
506 return yieldValueBasisPoint(bond, y, settlement);
507 }
508
510 const ext::shared_ptr<YieldTermStructure>& d,
511 Spread zSpread,
512 const DayCounter& dc,
513 Compounding comp,
514 Frequency freq,
515 Date settlement) {
516 if (settlement == Date())
517 settlement = bond.settlementDate();
518
519 return dirtyPrice(bond, d, zSpread, dc, comp, freq, settlement) - bond.accruedAmount(settlement);
520 }
521
523 const ext::shared_ptr<YieldTermStructure>& d,
524 Spread zSpread,
525 const DayCounter& dc,
526 Compounding comp,
527 Frequency freq,
528 Date settlement) {
529 if (settlement == Date())
530 settlement = bond.settlementDate();
531
532 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
533 "non tradable at " << settlement <<
534 " (maturity being " << bond.maturityDate() << ")");
535
537 zSpread, dc, comp, freq,
538 false, settlement) *
539 100.0 / bond.notional(settlement);
540 return dirtyPrice;
541 }
542
544 Real cleanPrice,
545 const ext::shared_ptr<YieldTermStructure>& d,
546 const DayCounter& dayCounter,
547 Compounding compounding,
548 Frequency frequency,
549 Date settlement,
550 Real accuracy,
551 Size maxIterations,
552 Rate guess) {
553 return zSpread(bond, {cleanPrice, Bond::Price::Clean}, d, dayCounter,
554 compounding, frequency, settlement, accuracy, maxIterations, guess);
555 }
556
558 Bond::Price price,
559 const ext::shared_ptr<YieldTermStructure>& d,
560 const DayCounter& dayCounter,
561 Compounding compounding,
562 Frequency frequency,
563 Date settlement,
564 Real accuracy,
565 Size maxIterations,
566 Rate guess) {
567 if (settlement == Date())
568 settlement = bond.settlementDate();
569
570 QL_REQUIRE(BondFunctions::isTradable(bond, settlement),
571 "non tradable at " << settlement <<
572 " (maturity being " << bond.maturityDate() << ")");
573
575 price.amount() +
576 (price.type() == Bond::Price::Clean ? bond.accruedAmount(settlement) : 0);
577
578 dirtyPrice /= 100.0 / bond.notional(settlement);
579
580 return CashFlows::zSpread(bond.cashflows(),
581 d,
583 dayCounter, compounding, frequency,
584 false, settlement, settlement,
585 accuracy, maxIterations, guess);
586 }
587}
bond functions
Bond price information.
Definition: bond.hpp:62
bool isValid() const
Definition: bond.hpp:72
Type type() const
Definition: bond.hpp:71
Real amount() const
Definition: bond.hpp:67
Base bond class.
Definition: bond.hpp:59
virtual Real accruedAmount(Date d=Date()) const
accrued amount at a given date
Definition: bond.cpp:267
const Leg & cashflows() const
Definition: bond.hpp:344
Date maturityDate() const
Definition: bond.cpp:150
virtual Real notional(Date d=Date()) const
Definition: bond.cpp:112
Date settlementDate(Date d=Date()) const
Definition: bond.cpp:161
static Date::serial_type accruedDays(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
Definition: cashflows.cpp:359
static Real previousCashFlowAmount(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
Definition: cashflows.cpp:143
static Rate previousCouponRate(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
Definition: cashflows.cpp:215
static Rate nextCouponRate(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
Definition: cashflows.cpp:224
static Date referencePeriodStart(const Leg &leg, bool includeSettlementDateFlows, Date settlDate=Date())
Definition: cashflows.cpp:279
static Real nextCashFlowAmount(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
Definition: cashflows.cpp:159
static Real yieldValueBasisPoint(const Leg &leg, const InterestRate &yield, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
Yield value of a basis point.
Definition: cashflows.cpp:1105
static Real accruedAmount(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
Definition: cashflows.cpp:377
static Real basisPointValue(const Leg &leg, const InterestRate &yield, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
Basis-point value.
Definition: cashflows.cpp:1058
static Leg::const_iterator nextCashFlow(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
the first cashflow paying after the given date
Definition: cashflows.cpp:102
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.
Definition: cashflows.cpp:1228
static Real npv(const Leg &leg, const YieldTermStructure &discountCurve, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
NPV of the cash flows.
Definition: cashflows.cpp:425
static Date accrualEndDate(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
Definition: cashflows.cpp:263
static Date accrualStartDate(const Leg &leg, bool includeSettlementDateFlows, Date settlDate=Date())
Definition: cashflows.cpp:247
static Leg::const_reverse_iterator previousCashFlow(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
the last cashflow paying before or at the given date
Definition: cashflows.cpp:84
static Date nextCashFlowDate(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
Definition: cashflows.cpp:131
static Time accrualPeriod(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
Definition: cashflows.cpp:311
static Date::serial_type accrualDays(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
Definition: cashflows.cpp:326
static Date maturityDate(const Leg &leg)
Definition: cashflows.cpp:52
static Time duration(const Leg &leg, const InterestRate &yield, Duration::Type type, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
Cash-flow duration.
Definition: cashflows.cpp:925
static Date startDate(const Leg &leg)
Definition: cashflows.cpp:38
static Date previousCashFlowDate(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
Definition: cashflows.cpp:119
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.
Definition: cashflows.cpp:510
static Real bps(const Leg &leg, const YieldTermStructure &discountCurve, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
Basis-point sensitivity of the cash flows.
Definition: cashflows.cpp:450
static Date referencePeriodEnd(const Leg &leg, bool includeSettlementDateFlows, Date settlDate=Date())
Definition: cashflows.cpp:295
static Time accruedPeriod(const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
Definition: cashflows.cpp:341
static Real convexity(const Leg &leg, const InterestRate &yield, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
Cash-flow convexity.
Definition: cashflows.cpp:974
Concrete date class.
Definition: date.hpp:125
std::int_fast32_t serial_type
serial number type
Definition: date.hpp:128
day counter class
Definition: daycounter.hpp:44
Concrete interest rate class.
safe Newton 1-D solver
Definition: newtonsafe.hpp:40
template class providing a null value for a given type.
Definition: null.hpp:76
void setMaxEvaluations(Size evaluations)
Definition: solver1d.hpp:238
Interest-rate term structure.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Definition: errors.hpp:117
Date d
Frequency
Frequency of events.
Definition: frequency.hpp:37
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Real Spread
spreads on interest rates
Definition: types.hpp:74
Real Rate
interest rates
Definition: types.hpp:70
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35
Compounding
Interest rate coumpounding rule.
Definition: compounding.hpp:32
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())