Lean  $LEAN_TAG$
QuantConnect.Lean.Engine.RealTime.ScheduledEventFactory Class Reference

Provides methods for creating common scheduled events More...

Static Public Member Functions

static ScheduledEvent EveryDayAt (string name, IEnumerable< DateTime > dates, TimeSpan timeOfDay, Action< string, DateTime > callback, DateTime? currentUtcTime=null)
 Creates a new ScheduledEvent that will fire at the specified timeOfDay for every day in dates More...
 
static ScheduledEvent EveryAlgorithmEndOfDay (IAlgorithm algorithm, IResultHandler resultHandler, DateTime start, DateTime end, TimeSpan endOfDayDelta, DateTime? currentUtcTime=null)
 Creates a new ScheduledEvent that will fire before market close by the specified time More...
 
static ScheduledEvent EverySecurityEndOfDay (IAlgorithm algorithm, IResultHandler resultHandler, Security security, DateTime start, DateTime end, TimeSpan endOfDayDelta, DateTime? currentUtcTime=null)
 Creates a new ScheduledEvent that will fire before market close by the specified time More...
 
static string CreateEventName (string scope, string name)
 Defines the format of event names generated by this system. More...
 

Detailed Description

Provides methods for creating common scheduled events

Definition at line 31 of file ScheduledEventFactory.cs.

Member Function Documentation

◆ EveryDayAt()

static ScheduledEvent QuantConnect.Lean.Engine.RealTime.ScheduledEventFactory.EveryDayAt ( string  name,
IEnumerable< DateTime >  dates,
TimeSpan  timeOfDay,
Action< string, DateTime >  callback,
DateTime?  currentUtcTime = null 
)
static

Creates a new ScheduledEvent that will fire at the specified timeOfDay for every day in dates

Parameters
nameAn identifier for this event
datesThe dates to set events for at the specified time. These act as a base time to which the timeOfDay is added to, that is, the implementation does not use .Date before the addition
timeOfDayThe time each tradeable date to fire the event
callbackThe delegate to call when an event fires
currentUtcTimeSpecfies the current time in UTC, before which, no events will be scheduled. Specify null to skip this filter.
Returns
A new ScheduledEvent instance that fires events each tradeable day from the start to the finish at the specified time

Definition at line 45 of file ScheduledEventFactory.cs.

◆ EveryAlgorithmEndOfDay()

static ScheduledEvent QuantConnect.Lean.Engine.RealTime.ScheduledEventFactory.EveryAlgorithmEndOfDay ( IAlgorithm  algorithm,
IResultHandler  resultHandler,
DateTime  start,
DateTime  end,
TimeSpan  endOfDayDelta,
DateTime?  currentUtcTime = null 
)
static

Creates a new ScheduledEvent that will fire before market close by the specified time

Parameters
algorithmThe algorithm instance the event is fo
resultHandlerThe result handler, used to communicate run time errors
startThe date to start the events
endThe date to end the events
endOfDayDeltaThe time difference between the market close and the event, positive time will fire before market close
currentUtcTimeSpecfies the current time in UTC, before which, no events will be scheduled. Specify null to skip this filter.
Returns
The new ScheduledEvent that will fire near market close each tradeable dat

Definition at line 66 of file ScheduledEventFactory.cs.

Here is the call graph for this function:

◆ EverySecurityEndOfDay()

static ScheduledEvent QuantConnect.Lean.Engine.RealTime.ScheduledEventFactory.EverySecurityEndOfDay ( IAlgorithm  algorithm,
IResultHandler  resultHandler,
Security  security,
DateTime  start,
DateTime  end,
TimeSpan  endOfDayDelta,
DateTime?  currentUtcTime = null 
)
static

Creates a new ScheduledEvent that will fire before market close by the specified time

Parameters
algorithmThe algorithm instance the event is fo
resultHandlerThe result handler, used to communicate run time errors
securityThe security used for defining tradeable dates
startThe first date for the events
endThe date to end the events
endOfDayDeltaThe time difference between the market close and the event, positive time will fire before market close
currentUtcTimeSpecfies the current time in UTC, before which, no events will be scheduled. Specify null to skip this filter.
Returns
The new ScheduledEvent that will fire near market close each tradeable dat

Definition at line 116 of file ScheduledEventFactory.cs.

Here is the call graph for this function:

◆ CreateEventName()

static string QuantConnect.Lean.Engine.RealTime.ScheduledEventFactory.CreateEventName ( string  scope,
string  name 
)
static

Defines the format of event names generated by this system.

Parameters
scopeThe scope of the event, example, 'Algorithm' or 'Security'
nameA name for this specified event in this scope, example, 'EndOfDay'
Returns
A string representing a fully scoped event name

Definition at line 162 of file ScheduledEventFactory.cs.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: