QuantLib Schedules and Actual/360 Day Counts
Summary
The explanation separates coupon-date schedule construction from day-count calculation in QuantLib. A schedule defines dates according to the effective date, maturity, interval, calendar, business-day convention, and date-generation rule. A day-count convention is applied afterward to measure the time between dates, for example when calculating coupon accruals. The same schedule can therefore be used with different day-count conventions.
The reported constructor error stems from passing a day-count object where the schedule expects an enumeration for a business-day convention. The example’s Actual/365 value is a Python proxy for an enumeration and is interpreted as a business-day convention value in that position; it does not set the schedule’s day count. The key practical lesson is to build the schedule with the correct business-day convention, then use an Actual/360 day counter separately when computing year fractions. The discussion addresses the conceptual API distinction rather than providing a complete bond pricing example.
Key ideas
- A schedule generates coupon dates; it does not encode the day-count convention.
- Day-count conventions measure accrual time between dates after the schedule is built.
- The schedule constructor expects a business-day convention in the relevant argument position.
- An enumeration proxy can be interpreted as a business-day convention rather than a day counter.
- Use an Actual/360 day counter separately when calculating year fractions.
Tags
Full text
# Actual360 convention in quantlib schedule # Actual360 convention in quantlib schedule I'm trying to make a payment schedule for different bonds in quantlib. For example, I made such a schedule: ``` schedule = ql.Schedule(effective_date, maturity_date, ql.Period(ql.Semiannual), ql.India(), ql.ModifiedFollowing, ql.Actual365Fixed.Standard, ql.DateGeneration.Backward, False) ``` However, when I am trying to make another schedule with actual/360 day convention, I can't find any method in the class ql.Actual360 (like Standard in ql.Actual365Fixed) that works. I just tried this code: ``` schedule = ql.Schedule(effective_date, maturity_date, ql.Period(ql.Quarterly), ql.India(), ql.ModifiedFollowing, ql.Actual360(), ql.DateGeneration.Backward, False) ``` with just ql.Actual360() instead. I received the following error: ``` TypeError: Wrong number or type of arguments for overloaded function 'new_Schedule'. ``` Is there a way to build a schedule with the Actual360 convention in `quantlib`? ## Answer by Luigi Ballabio (score 1) https://quant.stackexchange.com/a/76749 The day-count convention doesn't enter in the schedule construction, which gives you a set of coupon dates. It only matters after the schedule is built, and gives you a measure of the time between any two dates in the schedule. You can have the same schedule, but you can calculate the time between its dates according to different day-count conventions. The fact that the day count seems to be used in the first constructor is misleading. `ql.Actual365Fixed.Standard` is a Python proxy for an enumeration, and it's actually the number 0. At that place, the `Schedule` constructor expects a business-day convention, another enumeration, and your 0 is interpreted as `ql.Following`. You're not using act/365 at all, I'm afraid.
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.