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

  1. Create TradingPeriod enum in src/config.py or new src/utils/market_hours.py
  2. Add helper functions:
  • is_within_period(period: TradingPeriod) -> bool
  • get_current_period() -> TradingPeriod
  • get_next_period_start(period: TradingPeriod) -> datetime
  1. Handle timezone conversions (UTC to ET)
  2. Account for holidays/weekends

Acceptance Criteria

  • [ ] TradingPeriod enum 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

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗