Class DayCountConvention_ACT_ACT_ISDA

java.lang.Object
net.finmath.time.daycount.DayCountConvention_ACT
net.finmath.time.daycount.DayCountConvention_ACT_ACT_ISDA
All Implemented Interfaces:
Serializable, DayCountConvention

public class DayCountConvention_ACT_ACT_ISDA extends DayCountConvention_ACT implements Serializable
Implementation of ACT/ACT ISDA. Calculates the day count by calculating the actual number of days between startDate and endDate. A fractional day is rounded to the approximately nearest day. The day count fraction is calculated using ACT_ACT_ISDA convention, that is, the day count fraction is n1/365 + n2/366, where
  • n1 is the number of days falling into a non-leap year,
  • n2 is the number of days falling into a leap year,
where the start date is included in the counting and the end date is excluded in the counting. This means that from 31.12.2014 to 01.01.2015 the day count fraction is 1/366 since 2014 is a leap year.

The class passed that standard benchmark test in the IDSA document see net.finmath.tests.time.daycount.DayCountConventionTest

The class can be constructed using isCountLastDayNotFirst = true, which will change its behavior compared to above. In this case the start date is excluded in the counting and the end date is included in the counting. This means that from 31.12.2014 to 01.01.2015 the day count fraction is 1/365 since 2015 is not a leap year.

Version:
1.0
Author:
Christian Fries
See Also:
  • Constructor Details

    • DayCountConvention_ACT_ACT_ISDA

      public DayCountConvention_ACT_ACT_ISDA(boolean isCountFirstDayNotLast)
      Create an ACT/ACT ISDA day count convention.
      Parameters:
      isCountFirstDayNotLast - If this value is false (default), the days are counted including the first day and excluding the last day. If this field is true, the days are counted excluding the first day and including the last day.
    • DayCountConvention_ACT_ACT_ISDA

      public DayCountConvention_ACT_ACT_ISDA()
      Create an ACT/ACT ISDA day count convention.
  • Method Details

    • getDaycountFraction

      public double getDaycountFraction(LocalDate startDate, LocalDate endDate)
      Description copied from interface: DayCountConvention
      Return the daycount fraction (year fraction) corresponding to the period from startDate to endDate given the specific daycount convention.
      Specified by:
      getDaycountFraction in interface DayCountConvention
      Parameters:
      startDate - The start date given as a LocalDate.
      endDate - The end date given as a LocalDate.
      Returns:
      The daycount year fraction corresponding to the given period.
    • toString

      public String toString()
      Overrides:
      toString in class Object