Skip to content

IDateRule

QuantConnect.Scheduling.IDateRule

Specifies dates that events should be fired, used in conjunction with the ITimeRule

name

name: str

Gets a name for this rule

get_dates

get_dates(
    start: Union[datetime, date], end: Union[datetime, date]
) -> Sequence[datetime]

Gets the dates produced by this date rule between the specified times

Parameters:

Name Type Description Default
start Union[datetime, date]

The start of the interval to produce dates for

required
end Union[datetime, date]

The end of the interval to produce dates for

required

Returns:

Type Description
Sequence[datetime]

All dates in the interval matching this date rule.

to_func

to_func() -> Callable[[datetime], Optional[datetime]]

Converts a date rule into a function that receives current time and returns the next date.

Returns:

Type Description
Callable[[datetime], Optional[datetime]]

A function that will enumerate the provided date rules.