Skip to content

ScheduledEvent

QuantConnect.Scheduling.ScheduledEvent

ScheduledEvent(
    name: str,
    event_utc_time: Union[datetime, date],
    callback: Callable[[str, datetime], Any] = None,
)
ScheduledEvent(
    name: str,
    ordered_event_utc_times: List[datetime],
    callback: Callable[[str, datetime], Any] = None,
)
ScheduledEvent(
    name: str,
    ordered_event_utc_times: IEnumerator[datetime],
    callback: Callable[[str, datetime], Any] = None,
)

Bases: Object, IDisposable

Real time self scheduling event

Initializes a new instance of the ScheduledEvent class

Parameters:

Name Type Description Default
name str

An identifier for this event

required
event_utc_time Optional[Union[datetime, date]]

The date time the event should fire

None
callback Callable[[str, datetime], Any]

Delegate to be called when the event time passes

None
ordered_event_utc_times Optional[List[datetime] | IEnumerator[datetime]]

An enumerable that emits event times

None

SECURITY_END_OF_DAY_DELTA

SECURITY_END_OF_DAY_DELTA: timedelta = ...

Gets the default time before market close end of trading day events will fire

ALGORITHM_END_OF_DAY_DELTA

ALGORITHM_END_OF_DAY_DELTA: timedelta = ...

Gets the default time before midnight end of day events will fire

event_fired

event_fired: _EventContainer[
    Callable[[str, datetime], Any], Any
]

Event that fires each time this scheduled event happens

enabled

enabled: bool

Gets or sets whether this event is enabled

next_event_utc_time

next_event_utc_time: datetime

Gets the next time this scheduled event will fire in UTC

name

name: str

Gets an identifier for this event

equals

equals(obj: Any) -> bool

Determines whether the specified object is equal to the current object.

Parameters:

Name Type Description Default
obj Any

The object to compare with the current object.

required

Returns:

Type Description
bool

true if the specified object is equal to the current object; otherwise, false.

get_hash_code

get_hash_code() -> int

Serves as the default hash function.

Returns:

Type Description
int

A hash code for the current object.

on_event_fired

on_event_fired(trigger_time: Union[datetime, date]) -> None

Event invocator for the event_fired event

This codeEntityType is protected.

Parameters:

Name Type Description Default
trigger_time Union[datetime, date]

The event's time in UTC

required

to_string

to_string() -> str

Will return the ScheduledEvents name