Expand description
Execution algorithm infrastructure for order slicing and execution optimization.
This module provides the ExecutionAlgorithm trait and supporting infrastructure
for implementing algorithms like TWAP (Time-Weighted Average Price) and VWAP
(Volume-Weighted Average Price) that slice large orders into smaller child orders.
§Architecture
Execution algorithms extend [DataActor] (not Strategy) because:
- They don’t own positions (the parent Strategy does).
- Spawned orders carry the parent Strategy’s ID, not the algorithm’s ID.
- They act as order processors/transformers, not position managers.
§Order Flow
- A Strategy submits an order with
exec_algorithm_idset. - The order is routed to the algorithm’s
{id}.executeendpoint. - The algorithm receives the order via
on_order(). - The algorithm spawns child orders using
spawn_market(),spawn_limit(), etc. - Spawned orders are submitted through the RiskEngine.
- The algorithm receives fill events and manages remaining quantity.
Re-exports§
pub use core::ExecutionAlgorithmCore;pub use config::ExecutionAlgorithmConfig;pub use twap::TwapAlgorithm;pub use twap::TwapAlgorithmConfig;
Modules§
- config
- Configuration for execution algorithms.
- core
- Core component for execution algorithms.
- twap
- Time-Weighted Average Price (TWAP) execution algorithm.
Traits§
- Execution
Algorithm - Core trait for implementing execution algorithms in NautilusTrader.