pub struct Schedule {
pub dates: Vec<NaiveDate>,
}Expand description
A periodic date schedule: unadjusted anchor dates rolled from a period, then business-day adjusted. Used for autocallable observation dates, coupon schedules and averaging fixings.
Fields§
§dates: Vec<NaiveDate>Adjusted, strictly increasing dates, ending at the (adjusted) termination date. The effective date itself is not included.
Implementations§
Source§impl Schedule
impl Schedule
Sourcepub fn generate(
effective: NaiveDate,
termination: NaiveDate,
months: u32,
calendar: &Calendar,
convention: BusinessDayConvention,
generation: DateGeneration,
) -> Result<Schedule, RustyQLibError>
pub fn generate( effective: NaiveDate, termination: NaiveDate, months: u32, calendar: &Calendar, convention: BusinessDayConvention, generation: DateGeneration, ) -> Result<Schedule, RustyQLibError>
Generate a schedule from effective (exclusive) to termination
(inclusive) every months months.
Backward generation rolls anchor dates back from termination, so a
remainder shorter than a full period becomes a short front stub;
forward generation rolls from the effective date and leaves a short
back stub. Anchor dates are adjusted with convention;
duplicates after adjustment collapse.
Sourcepub fn year_fractions(
&self,
valuation: NaiveDate,
day_count: DayCountConvention,
) -> Vec<f64>
pub fn year_fractions( &self, valuation: NaiveDate, day_count: DayCountConvention, ) -> Vec<f64>
Year fractions of every schedule date from valuation under the
given day count.