Variables
Types
Schedule
type
Data type that manages a collection of scheduling rules, allowing for specific times and exceptions to be defined.
Methods
__contains__
(d) -> bool
Checks whether a given timestamp falls within the defined schedule. Returns
True
if the timestamp falls within the schedule’s active periods, otherwise returns False
.Determines whether two timestamps fall within the same schedule period on the same day. Returns
True
if both timestamps fall within the same period of the schedule, even if they are in different calendar days. False if the timestamps belong to different periods within the schedule.This method checks if two timestamps, which may belong to different calendar days, are part of the same schedule period. It handles cases where a schedule spans across two consecutive days (e.g., a trading schedule that extends past midnight) and ensures both timestamps belong to the same logical period within the schedule.
See also:
TradingSession
ScheduleRule
ScheduleRule
type
Data type to represent a rule for a schedule, specifying the start and end times, along with the weekdays when the rule is active.
Example
For rules that span overnight (e.g., from 10:00 PM to 6:00 AM), the end time should be on the day listed in days, while the start time is understood to be on the previous day. This allows the rule to cover activities that occur late in the evening and extend into the early hours of the next day.
See also:
Schedule
TradingSession
Enums
week_day
enum
Enum-like class with constants for days of week.
Static fields