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.
MarketHours has a parameterless constructor, and one that initializes the OpenTime and CloseTime properties using the mktOpen and mktClose parameters.
Returns true if the market is open 24 hours. A market is considered always open when its OpenTime and CloseTime are equal.
Returns a new MarketHours instance with the same OpenTime and CloseTime values as this instance.
Contains the market's closing time.
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.
Contains the market's opening time.
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).
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.