Parent: Object
The MarketWeeklyHours class represents the trading hours for each day of a market's week. It maintains a collection of MarketHours instances keyed by day of week, with an optional default entry that applies when a specific day does not have its own hours defined. A key value of -1 represents the default market hours.
Creates a new MarketWeeklyHours instance. If createCleared is false, the instance is initialized with default market hours of 9:30 AM to 4:00 PM under the -1 default key. If createCleared is true, the instance is created without any market hour mappings.
Removes all market hour mappings from the instance.
Returns a new MarketWeeklyHours instance containing copies of all of the MarketHours mappings in this instance.
Returns a new MarketWeeklyHours instance containing the same mappings as this instance, but with offset hours added to each opening and closing time. Use MarketDetails.GetTimeZoneDifferenceInHours to calculate an appropriate offset when converting weekly hours between market time zones.
Converts a three-letter day abbreviation such as "MON", "TUE", or "FRI" into the corresponding DayOfWeek value.
Returns the MarketHours associated with the specified day of week. The first overload accepts a DayOfWeek value. The second accepts its integer equivalent, where Sunday is 0 through Saturday at 6. If no specific MarketHours mapping exists for the requested day, the default mapping stored under key -1 is returned.
Returns a readable description of the market's weekly trading hours. The default hours are listed first, followed by any day-specific overrides. For example, a market might produce a string containing its standard hours followed by a special Friday schedule.
Returns the Dictionary containing the market hour mappings. Keys from 0 through 6 correspond to DayOfWeek values Sunday through Saturday. The key -1 represents the default market hours used when no day-specific mapping exists.
Creates and returns a MarketWeeklyHours instance from the persisted market-hours tokens supplied in tokens. The first two tokens define the default opening and closing times. Any remaining tokens define day-specific overrides using a three-letter day abbreviation followed by opening and closing times.
Assigns market hours for the specified dayOfWeek. Pass a value from 0 through 6 corresponding to Sunday through Saturday to define hours for a specific day. Pass -1 to define the default market hours used for days that do not have their own specific mapping.
Returns a persisted string representation of the day-specific market hours. Only mappings for specific days are included. The default -1 mapping is not included because it is persisted separately by MarketDetails.