0
$\begingroup$

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'))
$\endgroup$
3
  • $\begingroup$ Why do you say that Friday, December 31, 2021 is a U.S. holiday? Which U.S. calendar (NYSE, SIFMA, etc) shows that? Invoking "ql.UnitedStates()" without being more specific is a bad idea. $\endgroup$ Jan 6, 2021 at 13:20
  • $\begingroup$ it's USD settlement holiday.. it's just a currency holiday $\endgroup$
    – user51725
    Jan 7, 2021 at 6:20
  • $\begingroup$ Sorry, dk "currency holiday". $\endgroup$ Aug 25, 2021 at 13:10

2 Answers 2

2
$\begingroup$

With end-of-month set to False, the schedule doesn't even try to hit the 31st; it starts from a stub on the 30th, so it uses the 30th of the month for all other dates.

Unfortunately, as you say, you can't set end-of-month to True in this case; so you'll probably have to use the Schedule constructor that takes an explicit list of dates (you can generate them by starting a mock schedule on March 31st and removing the June stub). In Python, the constructor can also take a number of other parameters: this will enable bonds and other instruments to use the schedule correctly. You can see the full signature here.

$\endgroup$
0
$\begingroup$

These dates are not included as US holidays in QuantLib's United States calendar. They are considered as business days.

import QuantLib as ql
print(ql.UnitedStates().isBusinessDay(ql.Date(31, 12, 2020)))
print(ql.UnitedStates().isBusinessDay(ql.Date(30, 3, 2021)))
print(ql.UnitedStates().isBusinessDay(ql.Date(30, 3, 2022)))

The above lines check if the 31st December 2020, the 30th March 2021, and the 30th March 2022 are business days, and the returns are:

True

True

True

$\endgroup$
4
  • $\begingroup$ As I noted in my comment on the question, invoking "ql.UnitedStates()" without being more specific is a bad idea. $\endgroup$ Aug 25, 2021 at 13:12
  • 2
    $\begingroup$ In fact, the constructor with no arguments will be deprecated in next release (1.24). $\endgroup$ Oct 11, 2021 at 11:26
  • $\begingroup$ I'm very happy to hear this @LuigiBallabio . (In a past job, I had to deal with QL (frozen circa 2003) and this was oe of my pet peeves.) $\endgroup$ Oct 11, 2021 at 13:28
  • $\begingroup$ (v 0.3.3 embedded in "portfoliolib" :) $\endgroup$ Oct 12, 2021 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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