4

I'm working on a project where I'm using Quantlib to perform some bond calculations, such as yield and duration. Plugging in listing date maturity date, face value, calendar, day count convention etc and get the yield and duration value out is fairly simple.

It looks like given the issue date, maturity date, calendar and business day convention, Quantlib are able to calculate a the cash flow dates. And I have no reason to believe that the cash flow dates are incorrect. However I have the cash flow date, sink date, redemption dates from a data vendor and would like to use them instead of the dates Quantlib are calculating. How do I "plug" the cashflow dates into Quentlib?

1 Answers1

1

No such luck (as of now, at least).

It's possible to create a custom Schedule object with just a vector of dates, but it won't work when passed to a bond constructor. The bond will ask the schedule for additional information (such as the tenor) in order to build its coupons, and the schedule doesn't implement the heuristics to deduce it and will raise an exception.

Update: as of the last few QuantLib versions, it should be possible to pass a custom schedule to the bond constructor.

Luigi Ballabio
  • 4,128
  • 21
  • 29
  • Hi Luigi, so I wonder if it is possible to price a bond with short coupon or long coupon with quantlib. [Do you know if it is possible ? ](https://quant.stackexchange.com/q/76013/42110) – TourEiffel Jul 04 '23 at 14:54