0
$\begingroup$

I am currently using QuantLib for some bond pricing tasks and I have run into a problem which I hope someone here can help me with.

In my current project, I am required to model bond schedules that include both short and long coupons. However, my understanding is that the Schedule class in QuantLib is designed to handle bonds that have normal coupons only. This has led to inaccuracies in my output due to the inability of the Schedule class to account for the different coupon durations.

Here's an example of how I currently build the schedule:

schedule = ql.Schedule(self.issue_date,       
                            self.maturity_date,         
                            self.coupon_frequency,      
                            self.calendar,              
                            ql.Unadjusted,            
                            ql.Unadjusted,              
                            self.date_generation,       
                            False )                  

This generates a schedule with regular semiannual dates, which works fine for bonds with normal coupons. However, I'm not sure how to modify this to accommodate bonds with short or long coupons.

So, my question is: How can I build a custom schedule in QuantLib to account for short and long coupons?

print(list(schedule))
[Date(18,8,2021), Date(18,2,2022), Date(18,8,2022), Date(18,2,2023), Date(18,8,2023), Date(18,2,2024), Date(18,8,2024), Date(18,2,2025), Date(18,8,2025), Date(15,1,2026)]
$\endgroup$

1 Answer 1

1
$\begingroup$

The complete declaration of the Schedule constructor is

    Schedule(const Date& effectiveDate,
             const Date& terminationDate,
             const Period& tenor,
             const Calendar& calendar,
             BusinessDayConvention convention,
             BusinessDayConvention terminationDateConvention,
             DateGeneration::Rule rule,
             bool endOfMonth,
             const Date& firstDate = Date(),
             const Date& nextToLastDate = Date());

where the last two optional parameters can be used for your case. For a short or long first coupon, pass the end of the coupon as firstDate. For a short or long last coupon, pass the start of the coupon as nextToLastDate.

$\endgroup$
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.