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)]