Skip to content

Add TaskScheduler, PDT gate, and task classes#54

Merged
IamJasonBian merged 1 commit into
mainfrom
IamJasonBian/task-scheduler-pdt-gate
Mar 27, 2026
Merged

Add TaskScheduler, PDT gate, and task classes#54
IamJasonBian merged 1 commit into
mainfrom
IamJasonBian/task-scheduler-pdt-gate

Conversation

@IamJasonBian

Copy link
Copy Markdown
Owner

Summary

  • TradeTask ABC + ScheduledTask / DeferredTask (Command + Strategy pattern)
  • Executor gates every submission through PDTGate; PDT-blocked orders go into an in-memory deferred queue and are retried the next trading day
  • drain_deferred() called at top of each run_once() cycle
  • Fix pre-existing datetime serialization crash in blob_logger

Scope

Only touches trading_system/execution/ (2 new files), 3 lines in main.py, and the serialization bug fix.

Test plan

  • pytest tests/ — no regressions vs origin/main (7 pre-existing failures unchanged)
  • Dry run completes cleanly, state logged to state_logs/

- TradeTask ABC with should_execute() (Strategy pattern)
- ScheduledTask: executes on/after execute_date
- DeferredTask: PDT-blocked, retried next trading day
- Executor: gates submissions through PDTGate, owns deferred queue
- drain_deferred() called at top of each run_once() cycle
- Fix datetime serialization crash in blob_logger
@IamJasonBian IamJasonBian merged commit 62845b7 into main Mar 27, 2026
3 of 6 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