Skip to main content

Module session

Module session 

Source
Expand description

Trading session management and break detection.

Financial markets operate in defined sessions (e.g., NYSE 9:30 AM–4:00 PM ET). This module provides a pluggable SessionProvider trait for detecting session boundaries (daily, weekly, monthly, or custom) within bar data, plus concrete implementations:

ProviderDetects
DailySessionProviderDay boundaries (configurable break hour)
ExchangeSessionProviderSession opens of an instrument’s trading hours
WeeklySessionProviderWeek boundaries (configurable break day)
MonthlySessionProviderMonth boundaries
CompositeSessionProviderCombines multiple providers

Use find_session_breaks to scan a bar slice for all breaks.

Structs§

CompositeSessionProvider
Composite session provider that combines multiple providers.
DailySessionProvider
Daily session provider with a configurable break hour.
ExchangeSessionProvider
Daily session provider for an exchange: a day starts at each session open of its trading hours, in its time zone, so bars outside the hours stay with the session before them. Without trading hours a day starts at midnight in the time zone.
MonthlySessionProvider
Monthly session provider that detects calendar-month boundaries.
SessionBreak
A detected session break with metadata.
WeeklySessionProvider
Weekly session provider that detects boundaries after a configured UTC weekday.

Enums§

SessionBreakType
Classification of a session break.

Traits§

SessionProvider
Trait for defining trading session boundaries.

Functions§

find_session_breaks
Scan a bar slice for session breaks.