user3518798
user3518798

Reputation: 41

How to set a Custom Schedule Quantlib?

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?

Upvotes: 4

Views: 1256

Answers (1)

Luigi Ballabio
Luigi Ballabio

Reputation: 4333

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.

Upvotes: 1

Related Questions