I'm using the QuantLib library in Python to generate a payment schedule and cashflows for a fixed-rate bond. I added a holiday to the calendar and used the ql.Unadjusted convention in the ql.Schedule() function. However, I noticed that the cashflow dates are shifting to the next business day after the payment dates. For example, the payment date is 1,5,2022, but the corresponding cashflow date is 2,5,2022. But if i am checking schedule its giving correct 1,5,2022. below is the code:
import QuantLib as ql import pandas as pd issuedate = ql.Date(1,3,2022) maturityDate = ql.Date(1,6,2022) pay_freq = ql.Period(ql.Monthly) calendar = ql.NullCalendar() calendar.addHoliday(ql.Date(1,5,2022)) payment_Schedule = ql.Schedule(issuedate,maturityDate,pay_freq,calendar,ql.Unadjusted, ql.Unadjusted, ql.DateGeneration.Forward,False) rate = [0.05] daycount = ql.Actual365Fixed() nominals = cashflows = ql.FixedRateLeg(payment_Schedule,daycount,nominals,rate) cfs = pd.DataFrame([(a.date(),a.amount()) for a in cashflows]) cfs.columns = ["Date","Amount"] print('Schedule',list(payment_Schedule)) print(cfs)
which prints Scedule [Date(1,3,2022), Date(1,4,2022), Date(1,5,2022), Date(1,6,2022)] and cfs
Date Amount 0 April 1st, 2022 10616.438356 1 May 2nd, 2022 10273.972603 2 June 1st, 2022 10616.438356
Can anyone help me understand why the cashflow dates are shifting to the next business day after the payment dates, even though I'm using the ql.Unadjusted convention and I've added the holiday to the calendar? Is there something I'm missing in my code?