pub struct OrderManager<T: Exchange> { /* private fields */ }Expand description
High-level order manager that coordinates between risk management and execution
Implementations§
Source§impl<T: Exchange> OrderManager<T>
impl<T: Exchange> OrderManager<T>
Sourcepub fn new(
max_order_quantity: Decimal,
min_price: Decimal,
max_price: Decimal,
exchange: T,
) -> Self
pub fn new( max_order_quantity: Decimal, min_price: Decimal, max_price: Decimal, exchange: T, ) -> Self
Create a new order manager with risk limits
Sourcepub async fn submit_order(&mut self, order: Order) -> Result<()>
pub async fn submit_order(&mut self, order: Order) -> Result<()>
Submit an order for processing
The order will be validated by the risk manager before being sent to the exchange.
Sourcepub async fn start_event_processing(&mut self)
pub async fn start_event_processing(&mut self)
Start processing execution events
This method runs a loop that processes execution events from the exchange. It should be run in a separate task.
Auto Trait Implementations§
impl<T> Freeze for OrderManager<T>where
T: Freeze,
impl<T> RefUnwindSafe for OrderManager<T>where
T: RefUnwindSafe,
impl<T> Send for OrderManager<T>
impl<T> Sync for OrderManager<T>
impl<T> Unpin for OrderManager<T>where
T: Unpin,
impl<T> UnwindSafe for OrderManager<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more