Skip to content

fix(marketdata): respect exchange calendars across automatic workflows - #170

Merged
TNT-Likely merged 3 commits into
mainfrom
fix/trading-calendar-guards
Oct 3, 2026
Merged

TNT-Likely merged 3 commits into
mainfrom
fix/trading-calendar-guards

Conversation

@TNT-Likely

Copy link
Copy Markdown
Owner

Background

Calendar startup fetched and decoded decades of A-share history. Several automatic workflows treated weekdays or any open market as permission to process every market, producing holiday reports and simulated fills. Schedule previews showed holiday runs, while market-calendar times and scroll styling made the portfolio UI confusing.

Changes

  • Exchange calendar: remove network/history loading; warm only the previous 30 and next 90 days from published bundled data. Share market-local status, half-day sessions, eligible-market filtering, and future session openings.
  • Automatic workflows: filter scheduled Agents before context/data/AI work, including mixed-market batch portfolios. Activate existing single-stock schedule overrides without duplicating inherited jobs, reload saved schedules, and use the same gates for previews and health counts. Preserve configured Cron/interval values.
  • Alerts and paper trading: gate before quote requests, require each stock's open market for fills, reject known stale quote dates, and prevent live scans from bypassing holiday checks. Use exchange-local notification times, half-day closes, daily alert counters, and daily-summary boundaries. Filter opportunity refreshes and automatic TradingAgents linkage by eligible markets. Evaluate new outcomes using completed trading bars, preserving existing results.
  • Market UI: show all three calendars together with browser-timezone opening/session times, market-local current dates/statuses, cross-day labels, and daylight-saving conversion. Separate the header from scrolling rows, apply themed scrollbars, stop closed-market quote polling, and neutralize cached daily figures as market dates/statuses change.
  • Shared UI: replace native confirmation dialogs and selects across the application, reuse a localized asynchronous confirmation provider, and add themed scroll styling to remaining native scroll regions. Document bilingual UI conventions and enforce them with pnpm check:ui, also included in the existing CI translation-check command and frontend build.
  • README: simplify bilingual introductions and repeated feature descriptions, bring Docker startup forward, retain detailed references in existing folded sections, and fix navigation anchors. Preserve the original badges, GitHub Trending banner, demo, screenshot modules, and payment display states verbatim. Add a visible sponsorship contact using a mailto link with a prefilled subject in both languages.

Validation

  • .venv/bin/python -m pytest -q: 936 passed, 3 skipped.
  • pnpm --dir frontend exec vitest run: 192 passed across 46 files.
  • pnpm --dir frontend build: passed.
  • pnpm --dir frontend check:i18n, check:market-colors, and check:ui: passed.
  • git diff --check: passed.
  • Headless Chrome component preview with fixture calendars: verified 1440 px / 390 px, light / dark, themed transparent scrollbar tracks, stable headers after scrolling, shared selects, and confirmation dialogs.
  • README local links, navigation anchors, mailto recipient/subject, balanced folded sections, and unchanged visual/payment modules: verified.

Local JavaScript validation used Node 24.19.0 and pnpm 9.15.9; CI uses the repository-pinned Node 24.14.0.

Boundaries and risks

  • Bundled exchange data currently covers 2026. Unpublished weekdays are explicitly unknown and block automatic execution until annual data is updated.
  • Saved Agent cycles remain in the application timezone. Only built-in paper notification jobs move to each exchange's local clock.
  • Providers without a quote date retain compatibility; known stale dates are rejected, but missing timestamps cannot establish quote freshness.
  • Existing outcome records are not rewritten. Factor calibration excludes legacy calendar-day outcomes rather than mixing them with newly completed trading-day samples.
  • Visual validation used a component preview with fixtures, not a production account or real notification delivery.

Follow-up

Update and verify bundled annual exchange closures and half-days when the next year's schedules are published.

@TNT-Likely
TNT-Likely merged commit dc1e005 into main Oct 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant