Struct quantmath::dates::calendar::EveryDayCalendar [−][src]
pub struct EveryDayCalendar();
An every-day calendar assumes that all days are business days, including weekends.
Methods
impl EveryDayCalendar
[src]
impl EveryDayCalendar
pub fn new() -> EveryDayCalendar
[src]
pub fn new() -> EveryDayCalendar
pub fn from_serial<'de>(de: &mut Deserializer<'de>) -> Result<RcCalendar, Error>
[src]
pub fn from_serial<'de>(de: &mut Deserializer<'de>) -> Result<RcCalendar, Error>
Trait Implementations
impl Debug for EveryDayCalendar
[src]
impl Debug for EveryDayCalendar
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl TypeId for EveryDayCalendar
[src]
impl TypeId for EveryDayCalendar
impl Calendar for EveryDayCalendar
[src]
impl Calendar for EveryDayCalendar
fn name(&self) -> &str
[src]
fn name(&self) -> &str
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
fn is_holiday(&self, _date: Date) -> bool
[src]
fn is_holiday(&self, _date: Date) -> bool
Is the given date a holiday or weekend? The opposite of a business day.
fn count_business_days(
&self,
from: Date,
from_fraction: f64,
to: Date,
to_fraction: f64
) -> f64
[src]
fn count_business_days(
&self,
from: Date,
from_fraction: f64,
to: Date,
to_fraction: f64
) -> f64
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
fn step(&self, from: Date, step: i32, _slip_forward: bool) -> Date
[src]
fn step(&self, from: Date, step: i32, _slip_forward: bool) -> Date
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
fn standard_basis(&self) -> f64
[src]
fn standard_basis(&self) -> f64
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
fn day_weight(&self, date: Date) -> f64
[src]
fn day_weight(&self, date: Date) -> f64
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
fn step_partial(&self, from: Date, step: f64, slip_forward: bool) -> Date
[src]
fn step_partial(&self, from: Date, step: f64, slip_forward: bool) -> Date
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
fn year_fraction(&self, from: DateDayFraction, to: DateDayFraction) -> f64
[src]
fn year_fraction(&self, from: DateDayFraction, to: DateDayFraction) -> f64
Calculate the year-fraction between two date-times, given the count of business days and the standard basis. Read more
Auto Trait Implementations
impl Send for EveryDayCalendar
impl Send for EveryDayCalendar
impl Sync for EveryDayCalendar
impl Sync for EveryDayCalendar