Lean
$LEAN_TAG$
|
Helper class used to provide better syntax when defining time rules More...
Public Member Functions | |
TimeRules (SecurityManager securities, DateTimeZone timeZone) | |
Initializes a new instance of the TimeRules helper class More... | |
void | SetDefaultTimeZone (DateTimeZone timeZone) |
Sets the default time zone More... | |
ITimeRule | At (TimeSpan timeOfDay) |
Specifies an event should fire at the specified time of day in the algorithm's time zone More... | |
ITimeRule | At (int hour, int minute, int second=0) |
Specifies an event should fire at the specified time of day in the algorithm's time zone More... | |
ITimeRule | At (int hour, int minute, DateTimeZone timeZone) |
Specifies an event should fire at the specified time of day in the specified time zone More... | |
ITimeRule | At (int hour, int minute, int second, DateTimeZone timeZone) |
Specifies an event should fire at the specified time of day in the specified time zone More... | |
ITimeRule | At (TimeSpan timeOfDay, DateTimeZone timeZone) |
Specifies an event should fire at the specified time of day in the specified time zone More... | |
ITimeRule | Every (TimeSpan interval) |
Specifies an event should fire periodically on the requested interval More... | |
ITimeRule | AfterMarketOpen (Symbol symbol, double minutesAfterOpen=0, bool extendedMarketOpen=false) |
Specifies an event should fire at market open +- minutesAfterOpen More... | |
ITimeRule | BeforeMarketClose (Symbol symbol, double minutesBeforeClose=0, bool extendedMarketClose=false) |
Specifies an event should fire at the market close +- minutesBeforeClose More... | |
Public Attributes | |
ITimeRule | Now |
Specifies an event should fire at the current time More... | |
ITimeRule | Midnight => new FuncTimeRule("Midnight", dates => dates.Select(date => date.ConvertToUtc(_timeZone))) |
Convenience property for running a scheduled event at midnight in the algorithm time zone More... | |
ITimeRule | Noon => new FuncTimeRule("Noon", dates => dates.Select(date => date.ConvertToUtc(_timeZone).AddHours(12))) |
Convenience property for running a scheduled event at noon in the algorithm time zone More... | |
Helper class used to provide better syntax when defining time rules
Definition at line 29 of file TimeRules.cs.
QuantConnect.Scheduling.TimeRules.TimeRules | ( | SecurityManager | securities, |
DateTimeZone | timeZone | ||
) |
Initializes a new instance of the TimeRules helper class
securities | The security manager |
timeZone | The algorithm's default time zone |
Definition at line 40 of file TimeRules.cs.
void QuantConnect.Scheduling.TimeRules.SetDefaultTimeZone | ( | DateTimeZone | timeZone | ) |
Sets the default time zone
timeZone | The time zone to use for helper methods that can't resolve a time zone |
Definition at line 50 of file TimeRules.cs.
ITimeRule QuantConnect.Scheduling.TimeRules.At | ( | TimeSpan | timeOfDay | ) |
Specifies an event should fire at the specified time of day in the algorithm's time zone
timeOfDay | The time of day in the algorithm's time zone the event should fire |
Definition at line 84 of file TimeRules.cs.
ITimeRule QuantConnect.Scheduling.TimeRules.At | ( | int | hour, |
int | minute, | ||
int | second = 0 |
||
) |
Specifies an event should fire at the specified time of day in the algorithm's time zone
hour | The hour |
minute | The minute |
second | The second |
Definition at line 96 of file TimeRules.cs.
ITimeRule QuantConnect.Scheduling.TimeRules.At | ( | int | hour, |
int | minute, | ||
DateTimeZone | timeZone | ||
) |
Specifies an event should fire at the specified time of day in the specified time zone
hour | The hour |
minute | The minute |
timeZone | The time zone the event time is represented in |
Definition at line 108 of file TimeRules.cs.
ITimeRule QuantConnect.Scheduling.TimeRules.At | ( | int | hour, |
int | minute, | ||
int | second, | ||
DateTimeZone | timeZone | ||
) |
Specifies an event should fire at the specified time of day in the specified time zone
hour | The hour |
minute | The minute |
second | The second |
timeZone | The time zone the event time is represented in |
Definition at line 121 of file TimeRules.cs.
ITimeRule QuantConnect.Scheduling.TimeRules.At | ( | TimeSpan | timeOfDay, |
DateTimeZone | timeZone | ||
) |
Specifies an event should fire at the specified time of day in the specified time zone
timeOfDay | The time of day in the algorithm's time zone the event should fire |
timeZone | The time zone the date time is expressed in |
Definition at line 132 of file TimeRules.cs.
ITimeRule QuantConnect.Scheduling.TimeRules.Every | ( | TimeSpan | interval | ) |
Specifies an event should fire periodically on the requested interval
interval | The frequency with which the event should fire, can not be zero or less |
Definition at line 149 of file TimeRules.cs.
ITimeRule QuantConnect.Scheduling.TimeRules.AfterMarketOpen | ( | Symbol | symbol, |
double | minutesAfterOpen = 0 , |
||
bool | extendedMarketOpen = false |
||
) |
Specifies an event should fire at market open +- minutesAfterOpen
symbol | The symbol whose market open we want an event for |
minutesAfterOpen | The minutes after market open that the event should fire |
extendedMarketOpen | True to use extended market open, false to use regular market open |
Definition at line 167 of file TimeRules.cs.
ITimeRule QuantConnect.Scheduling.TimeRules.BeforeMarketClose | ( | Symbol | symbol, |
double | minutesBeforeClose = 0 , |
||
bool | extendedMarketClose = false |
||
) |
Specifies an event should fire at the market close +- minutesBeforeClose
symbol | The symbol whose market close we want an event for |
minutesBeforeClose | The time before market close that the event should fire |
extendedMarketClose | True to use extended market close, false to use regular market close |
Definition at line 194 of file TimeRules.cs.
ITimeRule QuantConnect.Scheduling.TimeRules.Now |
Specifies an event should fire at the current time
Definition at line 58 of file TimeRules.cs.
ITimeRule QuantConnect.Scheduling.TimeRules.Midnight => new FuncTimeRule("Midnight", dates => dates.Select(date => date.ConvertToUtc(_timeZone))) |
Convenience property for running a scheduled event at midnight in the algorithm time zone
Definition at line 72 of file TimeRules.cs.
ITimeRule QuantConnect.Scheduling.TimeRules.Noon => new FuncTimeRule("Noon", dates => dates.Select(date => date.ConvertToUtc(_timeZone).AddHours(12))) |
Convenience property for running a scheduled event at noon in the algorithm time zone
Definition at line 77 of file TimeRules.cs.