DayCounters
DayCounters.AFBActualActualDayCounters.Actual360DayCounters.Actual365DayCounters.Actual365FixedDayCounters.ActualActualDayCounters.AnnualDayCounters.ArgentinaCalendarDayCounters.BimonthlyDayCounters.BiweeklyDayCounters.BondActualActualDayCounters.BondBasisThirty360DayCounters.BrazilCalendarDayCounters.BrazilExchangeDayCounters.BrazilSettlementDayCounters.BusinessDayDayCounters.BusinessDayConventionDayCounters.BusinessMonthDayCounters.BusinessWeekDayCounters.BusinessYearDayCounters.DailyDayCounters.DayCountConventionDayCounters.EuroActualActualDayCounters.EurobondBasisThirty360DayCounters.EuropeanThirty360DayCounters.EveryFourthMonthDayCounters.EveryFourthWeekDayCounters.FederalReserveDayCounters.FollowingDayCounters.GermanThirty360DayCounters.GovernmentBondDayCounters.HalfMonthModifiedFollowingDayCounters.HistoricalActualActualDayCounters.ISDAActualActualDayCounters.ISMAActualActualDayCounters.ItalianThirty360DayCounters.LiborImpactDayCounters.ModifiedFollowingDayCounters.ModifiedPrecedingDayCounters.MonthlyDayCounters.NERCDayCounters.NYSEDayCounters.NearestDayCounters.NoFrequencyDayCounters.OnceDayCounters.OtherFrequencyDayCounters.PrecedingDayCounters.QuarterlyDayCounters.SemiannualDayCounters.SettlementDayCounters.TARGETCalendarDayCounters.Thirty360DayCounters.USAThirty360DayCounters.UnadjustedDayCounters.UnitedStatesCalendarDayCounters.WeeklyDayCounters.adjustdateDayCounters.advanceDayCounters.daycountDayCounters.daysperyearDayCounters.isbusinessdayDayCounters.isholidayDayCounters.yearfraction
DayCounters.AFBActualActual — TypeAFBActualActualAlso known as "Actual/Actual (Euro)" is a ActualActual subtype day count convention where the denominator is either 365 (if the calculation period does not contain 29th February) or 366 (if the calculation period includes 29th February). For periods longer than one year... to be completed.
DayCounters.Actual360 — TypeActual360([lastday = false])Day count convention, also known as "Actual/360", "Act/360", or "A/360". Can include the last day in computations depending on the lastday value.
DayCounters.Actual365 — TypeActual365Is an alias for ISDAActualActual.
DayCounters.Actual365Fixed — TypeActual365FixedDay count convention, also known as "Actual/365 (Fixed)", "Act/365 (Fixed)", or "A/365F".
According to ISDA, "Actual/365" (without "Fixed") is an alias for "Actual/Actual (ISDA)" (see ActualActual). If Actual/365 is not explicitly specified as fixed in an instrument specification, you might want to double-check its meaning.
DayCounters.ActualActual — TypeActualActualDay count convention that can be calculated according to the ISDA, ISMA and AFB conventions. The difference between these conventions lie in the computation of the denominator. The numerator is, in all cases, equal to the actual number of days between two dates, including the first one and excluding the last one.
For more details, please refer to https://www.isda.org/a/pIJEE/The-Actual-Actual-Day-Count-Fraction-1999.pdf.
DayCounters.Annual — TypeAnnualOnce a year.
DayCounters.ArgentinaCalendar — TypeArgentinaCalendarBuenos Aires, Argentina, stock exchange calendar.
DayCounters.Bimonthly — TypeBimonthlyEvery two months.
DayCounters.Biweekly — TypeBiweeklyEvery two weeks.
DayCounters.BondActualActual — TypeBondActualActualIs an alias for ISMAActualActual.
DayCounters.BondBasisThirty360 — TypeBondBasisThirty360Is an alias for USAThirty360.
DayCounters.BrazilCalendar — TypeBrazilCalendarBrazilian calendar.
DayCounters.BrazilExchange — TypeBrazilExchangeHolidays for the Bovespa stock exchange.
DayCounters.BrazilSettlement — TypeBrazilSettlementCalendar including public holidays.
DayCounters.BusinessDay — MethodBusinessDay(v)Construct a BusinessDay object with the given v value. Input must be losslessly convertible to an Int64.
DayCounters.BusinessDayConvention — TypeBusinessDayConventionSupertype for elements that provide algorithms used to adjust a date in case it is not a valid business day.
DayCounters.BusinessMonth — MethodBusinessMonth(v)Construct a BusinessMonth object with the given v value. Input must be losslessly convertible to an Int64.
DayCounters.BusinessWeek — MethodBusinessWeek(v)Construct a BusinessWeek object with the given v value. Input must be losslessly convertible to an Int64.
DayCounters.BusinessYear — MethodBusinessYear(v)Construct a BusinessYear object with the given v value. Input must be losslessly convertible to an Int64.
DayCounters.Daily — TypeDailyOnce a day.
DayCounters.DayCountConvention — TypeDayCountConventionSupertype for elements that provide methods for determining the length of a time period according to given market convention, both as a number of days and as a year fraction.
DayCounters.EuroActualActual — TypeEuroActualActualIs an alias for AFBActualActual.
DayCounters.EurobondBasisThirty360 — TypeEurobondBasisThirty360Is an alias for EuropeanThirty360.
DayCounters.EuropeanThirty360 — TypeEuropeanThirty360Also known as "30E/360", or "Eurobond Basis" is a Thirty360 subtype day count convention. Starting dates or ending dates that occur on the 31st of a month become equal to the 30th of the same month.
DayCounters.EveryFourthMonth — TypeEveryFourthMonthEvery four months.
DayCounters.EveryFourthWeek — TypeEveryFourthWeekEvery four weeks.
DayCounters.FederalReserve — TypeFederalReserveto be done.
DayCounters.Following — TypeFollowingA BusinessDayConvention subtype that chooses the first business day after the given holiday.
DayCounters.GermanThirty360 — TypeGermanThirty360([islastperiod = false])Also known as "30E/360 ISDA" is a Thirty360 subtype day count convention. Starting dates or ending dates that occur on the last day of February become equal to 30 for computational sake, except for the termination date.
DayCounters.GovernmentBond — TypeGovernmentBondGovernment bond market calendar (data from http://www.bondmarkets.com).
DayCounters.HalfMonthModifiedFollowing — TypeHalfMonthModifiedFollowingA BusinessDayConvention subtype that chooses the first business day after the given holiday unless that day crosses the mid-month (15th) or the end of month, in which case choose the first business day before the holiday.
DayCounters.HistoricalActualActual — TypeHistoricalActualActualIs an alias for ISDAActualActual.
DayCounters.ISDAActualActual — TypeISDAActualActualAlso known as "Actual/Actual (Historical)", "Actual/Actual", "Act/Act", and according to ISDA also "Actual/365", "Act/365", and "A/365", is a ActualActual subtype day count convention where the denominator varies depending on whether a portion of relevant calculation period falls within a leap year (for the portion of the calculation period falling within a leap year, the denominator is 366 and for the portion falling outside a leap year, the denominator is 365).
DayCounters.ISMAActualActual — TypeISMAActualActualAlso known as "Actual/Actual (Bond)" is a ActualActual subtype day count convention where the denominator is the actual number of days in the period...
DayCounters.ItalianThirty360 — TypeItalianThirty360Is a Thirty360 subtype day count convention. Starting dates or ending dates that occur on February and are grater than 27 become equal to 30 for computational sake.
DayCounters.LiborImpact — TypeLiborImpactto be done.
DayCounters.ModifiedFollowing — TypeModifiedFollowingA BusinessDayConvention subtype that chooses the first business day after the given holiday unless it belongs to a different month, in which case choose the first business day before the holiday.
DayCounters.ModifiedPreceding — TypeModifiedPrecedingA BusinessDayConvention subtype that chooses the first business day before the given holiday unless it belongs to a different month, in which case choose the first business day after the holiday.
DayCounters.Monthly — TypeMonthlyOnce a month.
DayCounters.NERC — TypeNERCNorth American Energy Reliability Council calendar (data from http://www.nerc.com/~oc/offpeaks.html):
DayCounters.NYSE — TypeNYSEStock exchange calendar (data from http://www.nyse.com).
DayCounters.Nearest — TypeNearestA BusinessDayConvention subtype that chooses the nearest business day to the given holiday. If both the preceding and following business days are equally far away, default to following business day.
DayCounters.NoFrequency — TypeNoFrequencyNull frequency.
DayCounters.Once — TypeOnceOnly once, e.g., a zero-coupon.
DayCounters.OtherFrequency — TypeOtherFrequencySome other unknown frequency.
DayCounters.Preceding — TypePrecedingA BusinessDayConvention subtype that chooses the first business day before the given holiday.
DayCounters.Quarterly — TypeQuarterlyEvery three months.
DayCounters.Semiannual — TypeSemiannualTwice a year.
DayCounters.Settlement — TypeSettlementCalendar including public holidays (see: http://www.opm.gov/fedhol/).
DayCounters.TARGETCalendar — TypeTARGETCalendarTARGET calendar (European Central Bank).
DayCounters.Thirty360 — TypeThirty360Day count convention that can be calculated according to to US, European, Italian or German conventions.
DayCounters.USAThirty360 — TypeUSAThirty360Also known as "30/360", "360/360", or "Bond Basis" is a Thirty360 subtype day count convention. If the starting date is the 31st of a month, it becomes equal to the 30th of the same month. 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.
DayCounters.Unadjusted — TypeUnadjustedA BusinessDayConvention subtype that provides no date adjustment.
DayCounters.UnitedStatesCalendar — TypeUnitedStatesCalendarSupertype for United States calendars.
DayCounters.Weekly — TypeWeeklyOnce a week.
DayCounters.adjustdate — Functionadjustdate(dt::Date, calendar::BusinessCalendar, [convention::BusinessDayConvention = Following()]) -> DateAdjusts a non-business day to the appropriate near business day with respect to the given convention. The convention defaults to Following if not provided.
DayCounters.advance — Functionadvance(dt::Date, step::DatePeriod, calendar::BusinessCalendar, [convention::BusinessDayConvention = Following()])Advances the given date dt, step number of days and returns the result. step can be either a DatePeriod or a BusinessDatePeriod. In the first case, the date advances using calendar days and if it falls in a holiday (i.e., a non business day), it is adjusted using the convention. On the second case, the date advances using business days, so it is expected that step can be converted to BusinessDay. It is important to note that if the provided step is either 0 days or 0 businessdays and dt is a holiday, it will be adjusted using the convention.
julia> dt = Date(2001, 12, 26)
2001-12-26
julia> advance(dt, Day(4), ArgentinaCalendar())
2002-01-02
julia> advance(dt, BusinessDay(4), ArgentinaCalendar())
2002-01-03
julia> dt = Date(2002, 1, 1)
2002-01-01
julia> advance(dt, Day(0), ArgentinaCalendar())
2002-01-02
julia> advance(dt, BusinessDay(0), ArgentinaCalendar())
2002-01-02DayCounters.daycount — Functiondaycount(dt1::Date, dt2::Date, convention::DayCountConvention) -> Int64Returns the number of days between two dates considering the corresponding DayCountConvention.
DayCounters.daysperyear — Functiondaysperyear(::DayCountConvention) -> Int64Returns the number of days in a year considering the corresponding DayCountConvention.
DayCounters.isbusinessday — Functionisbusinessday(dt::Date, calendar::BusinessCalendar) -> BoolProvides methods for determining whether a date dt is or not a business day. A calendar, defined for specific exchange holiday schedule or for general country holiday schedule, must be provided.
DayCounters.isholiday — Methodisholiday(dt::Date, calendar::BusinessCalendar) -> BoolProvides methods for determining whether a date dt is or not a holiday. A calendar, defined for specific exchange holiday schedule or for general country holiday schedule, must be provided.
DayCounters.yearfraction — Functionyearfraction(dt1::Date, dt2::Date, convention::DayCountConvention) -> RealReturns the period between two dates as a fraction of year considering the corresponding DayCountConvention.