Lean  $LEAN_TAG$
QuantConnect.Securities.MarketHoursSegment Class Reference

Represents the state of an exchange during a specified time range More...

Public Member Functions

 MarketHoursSegment (MarketHoursState state, TimeSpan start, TimeSpan end)
 Initializes a new instance of the MarketHoursSegment class More...
 
bool Contains (TimeSpan time)
 Determines whether or not the specified time is contained within this segment More...
 
bool Overlaps (TimeSpan start, TimeSpan end)
 Determines whether or not the specified time range overlaps with this segment More...
 
override string ToString ()
 Returns a string that represents the current object. More...
 

Static Public Member Functions

static MarketHoursSegment OpenAllDay ()
 Gets a new market hours segment representing being open all day More...
 
static MarketHoursSegment ClosedAllDay ()
 Gets a new market hours segment representing being open all day More...
 
static MarketHoursSegment[] GetMarketHoursSegments (TimeSpan extendedMarketOpen, TimeSpan marketOpen, TimeSpan marketClose, TimeSpan extendedMarketClose)
 Creates the market hours segments for the specified market open/close times More...
 

Properties

TimeSpan Start [get]
 Gets the start time for this segment More...
 
TimeSpan End [get]
 Gets the end time for this segment More...
 
MarketHoursState State [get]
 Gets the market hours state for this segment More...
 

Detailed Description

Represents the state of an exchange during a specified time range

Definition at line 26 of file MarketHoursSegment.cs.

Constructor & Destructor Documentation

◆ MarketHoursSegment()

QuantConnect.Securities.MarketHoursSegment.MarketHoursSegment ( MarketHoursState  state,
TimeSpan  start,
TimeSpan  end 
)

Initializes a new instance of the MarketHoursSegment class

Parameters
stateThe state of the market during the specified times
startThe start time of the segment
endThe end time of the segment

Definition at line 52 of file MarketHoursSegment.cs.

Here is the caller graph for this function:

Member Function Documentation

◆ OpenAllDay()

static MarketHoursSegment QuantConnect.Securities.MarketHoursSegment.OpenAllDay ( )
static

Gets a new market hours segment representing being open all day

Definition at line 62 of file MarketHoursSegment.cs.

Here is the call graph for this function:

◆ ClosedAllDay()

static MarketHoursSegment QuantConnect.Securities.MarketHoursSegment.ClosedAllDay ( )
static

Gets a new market hours segment representing being open all day

Definition at line 70 of file MarketHoursSegment.cs.

Here is the call graph for this function:

◆ GetMarketHoursSegments()

static MarketHoursSegment [] QuantConnect.Securities.MarketHoursSegment.GetMarketHoursSegments ( TimeSpan  extendedMarketOpen,
TimeSpan  marketOpen,
TimeSpan  marketClose,
TimeSpan  extendedMarketClose 
)
static

Creates the market hours segments for the specified market open/close times

Parameters
extendedMarketOpenThe extended market open time. If no pre market, set to market open
marketOpenThe regular market open time
marketCloseThe regular market close time
extendedMarketCloseThe extended market close time. If no post market, set to market close
Returns
An array of MarketHoursSegment representing the specified market open/close times

Definition at line 83 of file MarketHoursSegment.cs.

Here is the call graph for this function:

◆ Contains()

bool QuantConnect.Securities.MarketHoursSegment.Contains ( TimeSpan  time)

Determines whether or not the specified time is contained within this segment

Parameters
timeThe time to check
Returns
True if this segment contains the specified time, false otherwise

Definition at line 129 of file MarketHoursSegment.cs.

◆ Overlaps()

bool QuantConnect.Securities.MarketHoursSegment.Overlaps ( TimeSpan  start,
TimeSpan  end 
)

Determines whether or not the specified time range overlaps with this segment

Parameters
startThe start of the range
endThe end of the range
Returns
True if the specified range overlaps this time segment, false otherwise

Definition at line 140 of file MarketHoursSegment.cs.

◆ ToString()

override string QuantConnect.Securities.MarketHoursSegment.ToString ( )

Returns a string that represents the current object.

Returns
A string that represents the current object.

Definition at line 151 of file MarketHoursSegment.cs.

Here is the call graph for this function:

Property Documentation

◆ Start

TimeSpan QuantConnect.Securities.MarketHoursSegment.Start
get

Gets the start time for this segment

Definition at line 32 of file MarketHoursSegment.cs.

◆ End

TimeSpan QuantConnect.Securities.MarketHoursSegment.End
get

Gets the end time for this segment

Definition at line 38 of file MarketHoursSegment.cs.

◆ State

MarketHoursState QuantConnect.Securities.MarketHoursSegment.State
get

Gets the market hours state for this segment

Definition at line 44 of file MarketHoursSegment.cs.


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