Define trading time period enum (MARKET_HOURS, EXTENDED_HOURS, OVERNIGHT)
Resolved 💬 4 comments Opened Jan 13, 2026 by RickGurney Closed Feb 27, 2026
Summary
Add a trading time period enum to support different market session configurations.
Time Period Definitions (ET)
| Period | Start | End | Description |
|--------|-------|-----|-------------|
| MARKET_HOURS | 9:30 AM | 4:00 PM | Regular US market session |
| EXTENDED_HOURS | 4:00 AM - 9:30 AM | 4:00 PM - 8:00 PM | Pre-market + Post-market |
| OVERNIGHT | 8:00 PM | 4:00 AM | Overnight session (futures) |
Implementation
- Create
TradingPeriodenum insrc/config.pyor newsrc/utils/market_hours.py - Add helper functions:
is_within_period(period: TradingPeriod) -> boolget_current_period() -> TradingPeriodget_next_period_start(period: TradingPeriod) -> datetime
- Handle timezone conversions (UTC to ET)
- Account for holidays/weekends
Acceptance Criteria
- [ ]
TradingPeriodenum with 3 values - [ ] Helper functions to check current period
- [ ] Unit tests for period boundaries
- [ ] Handles DST transitions correctly
Related Issues
- Part of multi-timeframe trading support
- See also: Training data filter, Default config update
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗