Represents the market hours under normal conditions for an exchange and a specific day of the week in terms of local time
More...
|
| LocalMarketHours (DayOfWeek day, params MarketHoursSegment[] segments) |
| Initializes a new instance of the LocalMarketHours class More...
|
|
| LocalMarketHours (DayOfWeek day, IEnumerable< MarketHoursSegment > segments) |
| Initializes a new instance of the LocalMarketHours class More...
|
|
| LocalMarketHours (DayOfWeek day, TimeSpan extendedMarketOpen, TimeSpan marketOpen, TimeSpan marketClose, TimeSpan extendedMarketClose) |
| Initializes a new instance of the LocalMarketHours class from the specified open/close times More...
|
|
| LocalMarketHours (DayOfWeek day, TimeSpan marketOpen, TimeSpan marketClose) |
| Initializes a new instance of the LocalMarketHours class from the specified open/close times using the market open as the extended market open and the market close as the extended market close, effectively removing any 'extended' session from these exchange hours More...
|
|
TimeSpan? | GetMarketOpen (TimeSpan time, bool extendedMarketHours, TimeSpan? previousDayLastSegment=null) |
| Gets the market opening time of day More...
|
|
TimeSpan? | GetMarketClose (TimeSpan time, bool extendedMarketHours, TimeSpan? nextDaySegmentStart=null) |
| Gets the market closing time of day More...
|
|
bool | IsOpen (TimeSpan time, bool extendedMarketHours) |
| Determines if the exchange is open at the specified time More...
|
|
bool | IsOpen (TimeSpan start, TimeSpan end, bool extendedMarketHours) |
| Determines if the exchange is open during the specified interval More...
|
|
override string | ToString () |
| Returns a string that represents the current object. More...
|
|
Represents the market hours under normal conditions for an exchange and a specific day of the week in terms of local time
Definition at line 26 of file LocalMarketHours.cs.
◆ LocalMarketHours() [1/4]
Initializes a new instance of the LocalMarketHours class
- Parameters
-
day | The day of the week these hours are applicable |
segments | The open/close segments defining the market hours for one day |
Definition at line 61 of file LocalMarketHours.cs.
◆ LocalMarketHours() [2/4]
Initializes a new instance of the LocalMarketHours class
- Parameters
-
day | The day of the week these hours are applicable |
segments | The open/close segments defining the market hours for one day |
Definition at line 71 of file LocalMarketHours.cs.
◆ LocalMarketHours() [3/4]
QuantConnect.Securities.LocalMarketHours.LocalMarketHours |
( |
DayOfWeek |
day, |
|
|
TimeSpan |
extendedMarketOpen, |
|
|
TimeSpan |
marketOpen, |
|
|
TimeSpan |
marketClose, |
|
|
TimeSpan |
extendedMarketClose |
|
) |
| |
Initializes a new instance of the LocalMarketHours class from the specified open/close times
- Parameters
-
day | The day of week these hours apply to |
extendedMarketOpen | The extended market open time |
marketOpen | The regular market open time, must be greater than or equal to the extended market open time |
marketClose | The regular market close time, must be greater than the regular market open time |
extendedMarketClose | The extended market close time, must be greater than or equal to the regular market close time |
Definition at line 100 of file LocalMarketHours.cs.
◆ LocalMarketHours() [4/4]
QuantConnect.Securities.LocalMarketHours.LocalMarketHours |
( |
DayOfWeek |
day, |
|
|
TimeSpan |
marketOpen, |
|
|
TimeSpan |
marketClose |
|
) |
| |
Initializes a new instance of the LocalMarketHours class from the specified open/close times using the market open as the extended market open and the market close as the extended market close, effectively removing any 'extended' session from these exchange hours
- Parameters
-
day | The day of week these hours apply to |
marketOpen | The regular market open time |
marketClose | The regular market close time, must be greater than the regular market open time |
Definition at line 113 of file LocalMarketHours.cs.
◆ GetMarketOpen()
TimeSpan? QuantConnect.Securities.LocalMarketHours.GetMarketOpen |
( |
TimeSpan |
time, |
|
|
bool |
extendedMarketHours, |
|
|
TimeSpan? |
previousDayLastSegment = null |
|
) |
| |
Gets the market opening time of day
- Parameters
-
time | The reference time, the open returned will be the first open after the specified time if there are multiple market open segments |
extendedMarketHours | True to include extended market hours, false for regular market hours |
previousDayLastSegment | The previous days last segment. This is used when the potential next market open is the first segment of the day so we need to check that segment is not part of previous day last segment. If null, it means there were no segments on the last day |
- Returns
- The market's opening time of day
Definition at line 126 of file LocalMarketHours.cs.
◆ GetMarketClose()
TimeSpan? QuantConnect.Securities.LocalMarketHours.GetMarketClose |
( |
TimeSpan |
time, |
|
|
bool |
extendedMarketHours, |
|
|
TimeSpan? |
nextDaySegmentStart = null |
|
) |
| |
Gets the market closing time of day
- Parameters
-
time | The reference time, the close returned will be the first close after the specified time if there are multiple market open segments |
extendedMarketHours | True to include extended market hours, false for regular market hours |
nextDaySegmentStart | Next day first segment start. This is used when the potential next market close is the last segment of the day so we need to check that segment is not continued on next day first segment. If null, it means there are no segments on the next day |
- Returns
- The market's closing time of day
Definition at line 172 of file LocalMarketHours.cs.
◆ IsOpen() [1/2]
bool QuantConnect.Securities.LocalMarketHours.IsOpen |
( |
TimeSpan |
time, |
|
|
bool |
extendedMarketHours |
|
) |
| |
Determines if the exchange is open at the specified time
- Parameters
-
time | The time of day to check |
extendedMarketHours | True to check exended market hours, false to check regular market hours |
- Returns
- True if the exchange is considered open, false otherwise
Definition at line 221 of file LocalMarketHours.cs.
◆ IsOpen() [2/2]
bool QuantConnect.Securities.LocalMarketHours.IsOpen |
( |
TimeSpan |
start, |
|
|
TimeSpan |
end, |
|
|
bool |
extendedMarketHours |
|
) |
| |
Determines if the exchange is open during the specified interval
- Parameters
-
start | The start time of the interval |
end | The end time of the interval |
extendedMarketHours | True to check exended market hours, false to check regular market hours |
- Returns
- True if the exchange is considered open, false otherwise
Definition at line 248 of file LocalMarketHours.cs.
◆ ClosedAllDay()
◆ OpenAllDay()
◆ IsContinuousMarketOpen()
static bool QuantConnect.Securities.LocalMarketHours.IsContinuousMarketOpen |
( |
TimeSpan? |
previousSegmentEnd, |
|
|
TimeSpan? |
nextSegmentStart, |
|
|
bool |
prevSegmentIsFromPrevDay = true |
|
) |
| |
|
static |
Check the given segment is not part of the current previous segment
- Parameters
-
previousSegmentEnd | Previous segment end time before the current segment |
nextSegmentStart | The next segment start time |
prevSegmentIsFromPrevDay | Indicated whether the previous segment is from the previous day or not (then it is from the same day as the next segment). Defaults to true |
- Returns
- True if indeed the given segment is part of the last segment. False otherwise
Definition at line 304 of file LocalMarketHours.cs.
◆ ToString()
override string QuantConnect.Securities.LocalMarketHours.ToString |
( |
| ) |
|
Returns a string that represents the current object.
- Returns
- A string that represents the current object.
<filterpriority>2</filterpriority>
Definition at line 327 of file LocalMarketHours.cs.
◆ IsClosedAllDay
bool QuantConnect.Securities.LocalMarketHours.IsClosedAllDay |
|
get |
◆ IsOpenAllDay
bool QuantConnect.Securities.LocalMarketHours.IsOpenAllDay |
|
get |
◆ DayOfWeek
DayOfWeek QuantConnect.Securities.LocalMarketHours.DayOfWeek |
|
get |
◆ MarketDuration
TimeSpan QuantConnect.Securities.LocalMarketHours.MarketDuration |
|
get |
Gets the tradable time during the market day. For a normal US equity trading day this is 6.5 hours. This does NOT account for extended market hours and only considers MarketHoursState.Market
Definition at line 49 of file LocalMarketHours.cs.
◆ Segments
Gets the individual market hours segments that define the hours of operation for this day
Definition at line 54 of file LocalMarketHours.cs.
The documentation for this class was generated from the following file: