Order State Machine¶
Orders are represented by engine::Order and transition through a small set of statuses. Statuses are defined in include/regimeflow/engine/order.h.
Status Values¶
Createdorder was constructed by a strategy.Pendingorder submitted but not yet acknowledged.PartiallyFilledorder has partial fills.Filledorder is fully filled.Cancelledorder was cancelled.Rejectedorder was rejected by execution or broker.Invalidorder failed validation before submission.
Typical Flow¶
stateDiagram-v2
[*] --> Created
Created --> Pending
Pending --> PartiallyFilled
PartiallyFilled --> Filled
Pending --> Cancelled
Pending --> Rejected
Created --> Invalid
Notes¶
- Backtests use the execution pipeline to synthesize fills and update status.
- Live trading maps broker updates into internal
ExecutionReportmessages, which update order state.