Struct quantmath::dates::calendar::WeekdayAndHolidayCalendar[][src]

pub struct WeekdayAndHolidayCalendar { /* fields omitted */ }

A calendar that assumes that Saturday and Sunday are not business days, together with a specified list of business holidays. In general this list is read from a file.

Methods

impl WeekdayAndHolidayCalendar
[src]

Trait Implementations

impl Debug for WeekdayAndHolidayCalendar
[src]

Formats the value using the given formatter. Read more

impl TypeId for WeekdayAndHolidayCalendar
[src]

impl Calendar for WeekdayAndHolidayCalendar
[src]

The name of this calendar. Conventionally, the name is a three-letter upper-case string such as "TGT" or "NYS", though this is not required. Read more

TODO: is_holiday is an expensive call for WeekendAndHolidayCalendar. We still need to implement it for external users, but we should avoid calling it internally.

Count business days between the two given dates. The dates at the ends of the range may optionally be partly included in the count, by setting a fraction between zero and one. Read more

Step forward/backward by the given number of business days. The result is always a business day. If today is a business day, a zero step means staying where we are. If today is not a business day, we slip off to the nearest business day in the direction specified by the slip_forward flag. If the step is non-zero, the overall move is equivalent to a zero step followed by the given number of one-step moves. Read more

Returns the basis normally used for business day volatility. Roughly speaking this is the expected number of business days in a year, but conventionalised. It is 365 for EveryDayCalendar and 252 for a pure business day calendar. Read more

If the given date is a holiday, what weight should it receive? Returns 1.0 for a business day, 0.0 for a pure holiday with no weight, and potentially a number somewhere between for anything else. Read more

Specialised function where day-counts may be fractional, for example in volatility surfaces. For most calendars, the step is truncated towards zero and an integer number of steps is taken. Read more

Calculate the year-fraction between two date-times, given the count of business days and the standard basis. Read more

Auto Trait Implementations