Keeping Swap Schedule Dates Unadjusted in QuantLib
Summary
The document explains why a QuantLib schedule moves a swap's Saturday effective date to the following Monday. The schedule uses a business-day convention for date adjustment; the example uses Modified Following, which shifts a non-business date according to that convention. This changes the schedule's first date and may therefore fail to match a contract whose accrual begins on the original calendar date.
The recommended fix is to use the Unadjusted convention when constructing the schedule. That tells QuantLib to retain the specified dates without applying the business-day adjustment. The guidance addresses date generation for the schedule in the example. It does not discuss whether unadjusted dates are appropriate for a particular contract, nor how payment dates or other schedule settings should be handled.
Key ideas
- A schedule's business-day convention controls how non-business dates are adjusted.
- Modified Following moves the Saturday effective date in the example to a business day.
- Use the Unadjusted convention to retain the specified effective date in the schedule.
- Check the contract terms before choosing a date-adjustment convention.
Tags
Full text
# How to make the effective date to start on a holiday/weekend in py QuantLib?
# How to make the effective date to start on a holiday/weekend in py QuantLib?
I'm trying to price a non-standard swap. However, my schedule is not returning the correct dates. In particular, the effective date starts on a Saturday but the schedule returns the next biz date which is a Monday. I need to accrual to start on the effective date without adjustment. How can I tell the schedule object to not do that?
Below is my code.
```
fixed_leg_schedule = ql.Schedule(
ql.Date(26, ql.September, 2020),
ql.Date(25, ql.September, 2026),
ql.Period('1M'),
ql.UnitedStates(),
ql.ModifiedFollowing,
ql.ModifiedFollowing,
ql.DateGeneration.Backward,
False,
ql.Date(15, ql.October, 2020),
ql.Date(15, ql.September, 2026)
)
```
The 26th of Sept. 2020 is a Saturday, but the schedule returns 28th.
Thanks.
## Answer by Luigi Ballabio (score 1, accepted)
https://quant.stackexchange.com/a/54188
By passing `ql.ModifiedFollowing` you're telling the library to adjust non-business days based on that convention. If you don't want them adjusted, pass `ql.Unadjusted` instead.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.