Skip to content

Inconsistency in Day Count in Index Curve? #191

Description

@YimingZhang07

In swap_float_leg.py, we have the following logic to compute the forward rate for reference index.

dfStart = index_curve.df(startAccruedDt)
dfEnd = index_curve.df(endAccruedDt)
fwd_rate = (dfStart / dfEnd - 1.0) / index_alpha

index_alpha is a result of year fraction using a day counter initialized by the index day count type we specified. (for example, this is Thirty E 360 when constructing a IBOR curve)

(index_alpha, num, _) = index_day_counter.year_frac(startAccruedDt,
                                                    endAccruedDt)

However, dfStart and dfEnd, though using the same index curve, always discount by ACT_ACT_ISDA. This is because we didn't specify the day count type in its second argument.

def df(self,
       dt: (list, Date),
       day_count=DayCountTypes.ACT_ACT_ISDA):

I am unsure if this is a convention - but it seems odd to me as we are using two different day count types on a single curve for time fraction and discounting factors.

Just want to point out before I forget the details, take the time for this.

Thanks,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions