Skip to content

FuncDateRule

QuantConnect.Scheduling.FuncDateRule

FuncDateRule(name: str, get_dates_function: Any)
FuncDateRule(
    name: str,
    get_dates_function: Callable[
        [datetime, datetime], List[datetime]
    ],
)

Bases: Object, IDateRule

Uses a function to define an enumerable of dates over a requested start/end period

Signature descriptions:

  • Initializes a new instance of the FuncDateRule class using a Python function

  • Initializes a new instance of the FuncDateRule class

Parameters:

Name Type Description Default
name str

The name of this rule

required
get_dates_function Any | Callable[[datetime, datetime], List[datetime]]

The time applicator function in Python

required

name

name: str

Gets a name for this rule

get_dates

get_dates(
    start: Union[datetime, date], end: Union[datetime, date]
) -> Iterable[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
Iterable[datetime]

All dates in the interval matching this date rule.