Pricing Bonds at Future Dates with QuantLib Term Structures
Summary
The document explains how to value a bond at a future evaluation date and how that choice differs from changing the yield curve. Setting the evaluation date forward excludes cash flows that have already occurred. The bond’s issue date does not affect this step. For a floating-rate bond, the same date logic applies to its index and forecast curve.
The curve treatment depends on the scenario. To infer a future curve from today’s curve, an implied term structure can use the future date as its reference date, so its shorter-tenor rates correspond to forward rates from today’s curve. To shift today’s curve unchanged as the evaluation date moves, build the curve to move with that date; the answer notes this approach is often used for numerical theta calculations. These are distinct assumptions, and the document does not prescribe which one to use without knowing the intended scenario. It gives conceptual guidance rather than a complete implementation for every QuantLib interface.
Key ideas
- Set the evaluation date to the valuation date so cash flows before that date are excluded.
- The bond’s issue date does not determine this future-date valuation behavior.
- Use an implied term structure when deriving the future curve from today’s forward rates.
- A curve that moves with the evaluation date represents a different assumption and can support numerical theta calculations.
- Apply the same curve-date reasoning to a floating-rate index’s forecast curve.
Tags
Full text
# How to price a bond at specified dates in QuantLib # How to price a bond at specified dates in QuantLib I am wondering what's the most efficient way (i.e. the method which involves the fewest arguments) to price a bond at a specified date, e.g. a future date (as instance, 6 months from now) in QuantLib. Let the object of class `Bond` is then priced using `BondSetCouponPricer()` and `InstrumentSetPricingEngine()` with a non-flat object of `YieldTermStructure` class (like a zero yield curve): does this take into account the whole shape of the yield term structure, considering the bond is not priced today but at a "new" tenor due to the fact that in this simulation six months have passed? What if the `Bond` object is of `FloatingRateBond` class, thus having an `IborIndex` made up by an additional object of class `YieldTermStructure`? Does this take into consideration the "new" tenor due to the fact that in this simulation six months have passed? Thanks, ## Answer by Luigi Ballabio (score 6, accepted) https://quant.stackexchange.com/a/8895 There are two different issues at play here. One is that, of course, you want only the future cash flows to enter the calculation. This is taken care when you set the evaluation date to 6 months from today. In C++, you would say ``` Settings::instance().evaluationDate() = today + 6*Months; ``` I don't remember the corresponding function in QuantLibXL, but you can look for some function with "setEvaluationDate" in its name or something similar. On the hand, the issue date of the bond has no effect. The second issue is how you manage the term structure, and that depends on what you want to do. If, as I guess, you want to infer the future curve from today's one (so that, for instance, the spot 6-months rate on the new curve would be the forward 6-months to 1-year rate on today's curve) you can use—at least in C++; I hope it's exported to Excel—the `ImpliedTermStructure` class. It takes your current curve and a reference date (in your case, today + 6M) and builds a new curve with the desired behavior. If, instead—but I don't think it's your case, right?—you wanted to move today's curve to the new date as it is (that is, so that the spot 6-months rate on the new curve equals the spot 6-months rate on the old one) this can be done by building the curve so that it moves with the evaluation date. It's usually done to calculate the theta numerically by moving everything ahead one day. The above also applies to the floating-rate index and its forecast curve.
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.