Lean
$LEAN_TAG$
|
Helper class used to provide better syntax when defining time rules More...
Public Member Functions | |
TimeRules (SecurityManager securities, DateTimeZone timeZone, MarketHoursDatabase marketHoursDatabase) | |
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 | BeforeMarketOpen (Symbol symbol, double minutesBeforeOpen=0, bool extendedMarketOpen=false) |
Specifies an event should fire at market open +- minutesBeforeOpen More... | |
ITimeRule | AfterMarketOpen (Symbol symbol, double minutesAfterOpen=0, bool extendedMarketOpen=false) |
Specifies an event should fire at market open +- minutesAfterOpen More... | |
ITimeRule | AfterMarketClose (Symbol symbol, double minutesAfterClose=0, bool extendedMarketClose=false) |
Specifies an event should fire at the market close +- minutesAfterClose More... | |
ITimeRule | BeforeMarketClose (Symbol symbol, double minutesBeforeClose=0, bool extendedMarketClose=false) |
Specifies an event should fire at the market close +- minutesBeforeClose More... | |
Public Member Functions inherited from QuantConnect.Scheduling.BaseScheduleRules | |
BaseScheduleRules (SecurityManager securities, DateTimeZone timeZone, MarketHoursDatabase marketHoursDatabase) | |
Initializes a new instance of the TimeRules helper class 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... | |
Additional Inherited Members | |
Protected Member Functions inherited from QuantConnect.Scheduling.BaseScheduleRules | |
SecurityExchangeHours | GetSecurityExchangeHours (Symbol symbol) |
Helper method to fetch the security exchange hours More... | |
Properties inherited from QuantConnect.Scheduling.BaseScheduleRules | |
DateTimeZone | TimeZone [get, set] |
The algorithm's default time zone More... | |
SecurityManager | Securities [get, set] |
The security manager More... | |
MarketHoursDatabase | MarketHoursDatabase [get, set] |
The market hours database instance to use 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, | ||
MarketHoursDatabase | marketHoursDatabase | ||
) |
Initializes a new instance of the TimeRules helper class
securities | The security manager |
timeZone | The algorithm's default time zone |
marketHoursDatabase | The market hours database instance to use |
Definition at line 37 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 46 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 80 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 92 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 104 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 117 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 128 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 145 of file TimeRules.cs.
ITimeRule QuantConnect.Scheduling.TimeRules.BeforeMarketOpen | ( | Symbol | symbol, |
double | minutesBeforeOpen = 0 , |
||
bool | extendedMarketOpen = false |
||
) |
Specifies an event should fire at market open +- minutesBeforeOpen
symbol | The symbol whose market open we want an event for |
minutesBeforeOpen | The minutes before market open that the event should fire |
extendedMarketOpen | True to use extended market open, false to use regular market open |
Definition at line 163 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 175 of file TimeRules.cs.
ITimeRule QuantConnect.Scheduling.TimeRules.AfterMarketClose | ( | Symbol | symbol, |
double | minutesAfterClose = 0 , |
||
bool | extendedMarketClose = false |
||
) |
Specifies an event should fire at the market close +- minutesAfterClose
symbol | The symbol whose market close we want an event for |
minutesAfterClose | The time after market close that the event should fire |
extendedMarketClose | True to use extended market close, false to use regular market close |
Definition at line 202 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 214 of file TimeRules.cs.
ITimeRule QuantConnect.Scheduling.TimeRules.Now |
Specifies an event should fire at the current time
Definition at line 54 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 68 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 73 of file TimeRules.cs.