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': freq shifted by n hours, for schedules anchored to an intraday fixing

Parameters:
  • time_period (TimePeriod) – window to span; time_period.end is required

  • freq (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 offset

  • include_start_date (bool) – prepend time_period.start when the first scheduled date is later than it

  • include_end_date (bool) – append time_period.end when 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 period

  • is_business_dates (bool) – build on pd.bdate_range rather than pd.date_range

Returns:

schedule of dates; empty only if the period admits no date and neither include_start_date nor include_end_date is set

Raises:

ValueError – if time_period.end is None

Return type:

DatetimeIndex