Finance - Maple Programming Help

Home : Support : Online Help : Mathematics : Finance : Date Arithmetic : Finance/DayCounter

Finance

 DayCounter
 create a new day counter

 Calling Sequence DayCounter(convention)

Parameters

 convention - counting convention; possible values are: Actual360, Actual365Fixed, AFB, Bond, Euro, Historical, ISDA, ISMA, OneDay, Simple, Thirty360BondBasis, Thirty360EuroBondBasis, Thirty360European, Thirty360Italian, or Thirty360USA

Description

 • The DayCounter command creates a new day counter based on the specified convention. By default the Actual365Fixed convention is used. The default day count convention can be controlled through the Settings command.

Conventions

 • The following day count conventions are supported. See CalendarsAndDayCounters for more details.

 Actual360 The numerator is the same as ISDA below; the denominator is always 360. Actual365Fixed The numerator is the same as ISDA below; the denominator is always 365. AFB The numerator is the same as ISDA below; the denominator is either 365 if the calculation period does not include February 29th, or 366 if the calculation period includes February 29th. Bond Same meaning as ISMA Euro Same meaning as AFB. Historical Same meaning as ISDA. ISDA The numerator is equal to the actual number of days from (and including) the last coupon payment date or period end date, to (but excluding) the current value date or period end date; the denominator varies depending on whether a portion of the relevant calculation period falls within a leap year. For the portion of the calculation period falling within a leap year, the denominator is 366, for the other portion the denominator is 365. ISMA The numerator is the same as ISDA above; the denominator is the actual number of days in the coupon period multiplied by the number of coupon periods in the year. Simple This day counter tries to ensure that the whole-month distances are returned as a simple fraction. OneDay The numerator and denominator are both set to 1. Thirty360European This is one of the 30/360 day count conventions. Starting dates or ending dates that occur on the 31st of a month become equal to the 30th of the same month. Thirty360Italian This is one of the 30/360 day count conventions. Starting or ending dates that occur on February and are greater than 27 become equal to 30 for computational sake. Thirty360USA This is one of the 30/360 day count conventions. If the ending date is the 31st of a month and the starting date is earlier than the 30th of a month, the ending date becomes equal to the 1st of the next month, otherwise the ending date becomes equal to the 30th of the same month.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$
 > $\mathrm{daycounter1}≔\mathrm{DayCounter}\left(\right)$
 ${\mathrm{daycounter1}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (1)
 > ${\mathrm{daycounter1}}_{\mathrm{convention}}$
 ${\mathrm{Historical}}$ (2)
 > $\mathrm{DayCount}\left("Jan-01-2006","Nov-01-2006",\mathrm{daycounter1}\right)$
 ${304}$ (3)
 > $\mathrm{YearFraction}\left("Jan-01-2006","Nov-01-2006",\mathrm{daycounter1}\right)$
 ${0.8328767123}$ (4)
 > $\mathrm{daycounter2}≔\mathrm{DayCounter}\left(\mathrm{ISDA}\right)$
 ${\mathrm{daycounter2}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (5)
 > $\mathrm{DayCount}\left("Jan-01-2006","Nov-01-2006",\mathrm{daycounter2}\right)$
 ${304}$ (6)
 > $\mathrm{YearFraction}\left("Jan-01-2006","Nov-01-2006",\mathrm{daycounter2}\right)$
 ${0.8328767123}$ (7)
 > $\mathrm{daycounter3}≔\mathrm{DayCounter}\left(\mathrm{OneDay}\right)$
 ${\mathrm{daycounter3}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (8)
 > $\mathrm{DayCount}\left("Jan-01-2006","Nov-01-2006",\mathrm{daycounter3}\right)$
 ${1}$ (9)
 > $\mathrm{YearFraction}\left("Jan-01-2006","Nov-01-2006",\mathrm{daycounter3}\right)$
 ${1.}$ (10)

Note that the default value of the day counter can be changed using the Settings command.

 > ${\mathrm{DayCounter}\left(\right)}_{\mathrm{convention}}$
 ${\mathrm{Historical}}$ (11)
 > $\mathrm{Settings}\left(\mathrm{daycounter}=\mathrm{Simple}\right)$
 ${\mathrm{Historical}}$ (12)
 > ${\mathrm{DayCounter}\left(\right)}_{\mathrm{convention}}$
 ${\mathrm{Simple}}$ (13)

Compatibility

 • The Finance[DayCounter] command was introduced in Maple 15.