|
From: jian Xu <jia...@gm...> - 2022-03-02 06:08:02
|
Hi,
I'm confused by the "endOfMonth" setting. The document says:
```
endOfMonth : If the start date is at the end of the month, whether
other dates are required to be scheduled at the end of the month
(except the last date).
```
So my understanding is that if the start date is NOT the end of the
month, then this setting doesn't matter. (is this correct?)
However, it does matter in the following example. As the input
suggests, I expect the first date in the schedule should be 2018-03-29
(Thursday, NOT end of the month). However, I only get this result
when I set endOfMonth=False. If I set it to true, the first date in
the schedule will be 2018-03-31 (Saturday). Why?
Thanks a lot.
import QuantLib as ql
calendar = ql.UnitedStates(ql.UnitedStates.GovernmentBond)
schedule = ql.MakeSchedule(effectiveDate=ql.Date(29,3,2018),
terminationDate=ql.Date(29, 3, 2021),
tenor=ql.Period("3M"),
calendar=calendar,
convention=ql.Unadjusted,
terminalDateConvention=ql.Unadjusted,
rule=ql.DateGeneration.Forward,
endOfMonth=True,
firstDate=ql.Date(29, 6, 2018),
nextToLastDate=ql.Date())
print(schedule[0])
|