Suppose we have a semiannual coupon bond. The calculation date is 5/8 2017. The ex-coupon date is 4/20 2017 and next coupon date is 10/20 2017.

    issue_date= Date(20,10,2001)
    maturity_date=Date(20, 10, 2021)
    day_count= ActualActual(ActualActual.ISMA,schedule)

When I define the day_count, I specify the type and the coupon schedule. There are 165 days between 5/8 2017 and 10/20 2017, and 183 days in this period. This should be 0.4508(which is divided by frequency). Actually, I can get this by defining the coupon period:

    Out[1]: 0.45081967213114754

However, when I directly enter the calc_date, it returns a strange result.

    Out[2]: 0.4166666666666667

I think this will change the npv when I construct FlatForward yield curve and FixedRateBond.


In your second example (when no period is specified), the ActualActual.ISMA DayCounter basically returns

  RoundedNumberOfMonthsBetween(date1,date2) / 12 = 5 / 12 = 0.41666

whereas in the first one (when there is a specific period) some fancy adjustments are made based on the difference in days (20 - 8 + halfday = 12.5):

  RoundedNumberOfMonthsBetween(date1,date2) / 12 + 12.5/365 ≈ 0.4508

I am not entirely familiar with the exact adjustment. But for more details have a look at

  • $\begingroup$ This makes sense, thank you! But it seems that scheduledoesn't work as I thought. It should use the schedule and fill out refPeriodStart. When I use this day_count in FixedRateBond, there is no place to enter refPeriodStart, right? $\endgroup$ – Lindsey Jin Jun 7 '18 at 10:28
  • 2
    $\begingroup$ The fixed-rate bond knows the reference periods of its coupons and will pass them to the day counter. $\endgroup$ – Luigi Ballabio Jun 12 '18 at 10:53

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.