daycount creates a Daycount object. It accepts the following daycount rules: actual/365, actual/360, business/252 and 30E/360.

daycount(x, ...)

Arguments

x

a character representing a daycount rule, like: business/252, actual/365, actual/360, ...

...

additional arguments. Currently unused.

Value

A Daycount object.

Details

With actual/... and business/... the days between two dates are counted with the calendar of the rate. With 30E/360 (also called Eurobond basis) every month has 30 days: a date on the 31st is moved to the 30th, and the calendar is not used. Dates computed from the terms of a curve, as in maturities(), still use the calendar.

Examples

dc <- daycount("actual/360")

sr <- spotrate(0.05, "simple", "30E/360", "actual")
compound(sr, as.Date("2024-01-31"), as.Date("2024-03-31"))
#> [1] 1.008333