sorry the original question was answered by an expert but somehow I cannot edit the original question and add comments. so posting it again with some follow up questions: i have a number of bonds that I need to get coupon payment dates, an example is listed below: issue date is 2020-03-026, maturity date is 2020-09-30, and the bond pays coupon on quarterly basis. The first coupon date is 2020-06-30 so this has a long stub in the front.
the following code gives me
[Date(26,3,2020), Date(30,6,2020), Date(30,9,2020), Date(30,12,2020), Date(30,3,2021), Date(30,6,2021), Date(30,9,2021), Date(30,12,2021), Date(30,3,2022), Date(30,6,2022), Date(30,9,2022)]
however I expect to have that 3 highlighted to be 31st instead of 30th. 31Dec2021 is US holiday so it should stay as 30th Dec when using modified following. any suggestions on how to solve this? endOfMonth cannot be used here since the issue date 26th March is not end of month.
schedule = ql.Schedule(
ql.Date('26-03-2020', '%d-%m-%Y'),
ql.Date('30-09-2022', '%d-%m-%Y'),
ql.Period("3m"),
ql.UnitedStates(),
ql.ModifiedFollowing,
ql.ModifiedFollowing,
ql.DateGeneration.Forward,
False,
ql.Date('30-06-2020', '%d-%m-%Y'))