qis.generate_dates_schedule¶
- qis.generate_dates_schedule(time_period, freq='ME', hour_offset=None, include_start_date=False, include_end_date=False, is_business_dates=True)[source]¶
tz-aware schedule of dates spanning a time period at a given frequency.
The returned index carries the tz of
time_period. Beyond the pandas offset aliases, four bespoke frequencies are recognised:'SE': the start and end dates only'M-FRI'/'Q-FRI': the last Friday of each month / quarter'Q-3FRI': the third Friday of the last month of each quarter, the listed-derivative expiry convention'<freq>_<n>H', for example'D_8H':freqshifted bynhours, for schedules anchored to an intraday fixing
- Parameters:
time_period (TimePeriod) – window to span;
time_period.endis requiredfreq (str) – pandas offset alias (‘ME’, ‘QE’, ‘W-WED’, ‘B’, ‘h’) or one of the bespoke frequencies above
hour_offset (int | None) – hours added to every date after the schedule is built; ignored for the
'<freq>_<n>H'form, which sets its own offsetinclude_start_date (bool) – prepend
time_period.startwhen the first scheduled date is later than itinclude_end_date (bool) – append
time_period.endwhen the last scheduled date is earlier than it. The Friday and underscore frequencies drop their final date when this is False, so that the schedule does not run past the periodis_business_dates (bool) – build on
pd.bdate_rangerather thanpd.date_range
- Returns:
schedule of dates; empty only if the period admits no date and neither
include_start_datenorinclude_end_dateis set- Raises:
ValueError – if
time_period.endis None- Return type: