dcf#

rateslib.scheduling.dcf(start, end, convention, termination=NoInput.blank, frequency=NoInput.blank, stub=NoInput.blank, roll=NoInput.blank, calendar=NoInput.blank, adjuster=NoInput.blank)#

Calculate the day count fraction of a period.

Parameters:
  • start (datetime) – The adjusted start date of the calculation period.

  • end (datetime) – The adjusted end date of the calculation period.

  • convention (Convention, str) – The day count convention of the calculation period accrual. See notes.

  • termination (datetime, optional) – The adjusted termination date of the leg. Required only for some convention.

  • frequency (Frequency, str, optional) – The frequency of the period. Required only for some convention.

  • stub (bool, optional) – Indicates whether the period is a stub or not. Required only for some convention.

  • roll (str, int, optional) – Used only if frequency is given in string form. Required only for some convention.

  • calendar (str, Calendar, optional) – Used only of frequency is given in string form. Required only for some convention.

  • adjuster (Adjuster, str, optional) – The Adjuster used to convert unadjusted dates to adjusted accrual dates on the period. Required only for some convention.

Return type:

float

Notes

See Convention for permissible values and for argument related specifics.

Further information can be found in the 2006 ISDA definitions and 2006 ISDA 30360 example, and also in the lower level Rust documentation at rateslib-rs: Scheduling.

Examples

In [1]: dcf(dt(2000, 1, 1), dt(2000, 4, 3), "Act360")
Out[1]: 0.25833333333333336

In [2]: dcf(dt(2000, 1, 1), dt(2000, 4, 3), "Act365f")
Out[2]: 0.2547945205479452

In [3]: dcf(dt(2000, 1, 1), dt(2000, 4, 3), "ActActICMA", dt(2010, 1, 1), "Q", False)
Out[3]: 0.25

In [4]: dcf(dt(2000, 1, 1), dt(2000, 4, 3), "ActActICMA", dt(2010, 1, 1), "Q", True)
Out[4]: 0.2554347826086957