Search Framework:
MarketHours
Namespace: WealthLab.Core
Parent: Object

The MarketHours class represents the open and close times of a market, and is used to represent market trading hours in the MarketDetails class.

Constructors
MarketHours
public MarketHours()
public MarketHours(TimeSpan mktOpen, TimeSpan mktClose)

MarketHours has a parameterless constructor, and one that initializes the OpenTime and CloseTime properties using the mktOpen and mktClose parameters.



Members
AlwaysOpen
public bool AlwaysOpen

Returns true if the market is open 24 hours. A market is considered always open when its OpenTime and CloseTime are equal.


Clone
public MarketHours Clone()

Returns a new MarketHours instance with the same OpenTime and CloseTime values as this instance.


CloseTime
public TimeSpan CloseTime

Contains the market's closing time.


IsPrePostMarketTime
public bool IsPrePostMarketTime(DateTime dt, HistoryScale scale)

Returns true if the specified DateTime (dt) is considered to be outside the market's regular trading hours. The scale parameter is used when determining the starting time of a bar. This allows the method to correctly classify bars whose DateTime represents the end of a HistoryScale interval. For markets that are AlwaysOpen, this method always returns false. The method also handles markets whose trading sessions extend through midnight.


OpenTime
public TimeSpan OpenTime

Contains the market's opening time.


OpenTimeBaseLine
public TimeSpan OpenTimeBaseLine

Returns the baseline market opening time used by the Strategy Monitor. For markets that do not trade through midnight, this returns OpenTime. For markets that trade through midnight, it returns OpenTime, except for markets that are AlwaysOpen, where it returns midnight (00:00).


TradesThroughMidnight
public bool TradesThroughMidnight

Returns true if the market's trading session extends through midnight. A market is considered to trade through midnight when its CloseTime is earlier than its OpenTime.