Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Module: orders

Source: orders.rs

Order lifecycle management. Tracks pending orders, active stop-loss/take-profit levels, and order fill reconciliation via [OrderManager], [PendingOrder], and [ActiveStop].

Structs

pub struct ActiveStop

#![allow(unused)]
fn main() {
pub struct ActiveStop {
    pub client_id: String,
    pub side: Side,
    pub qty: f64,
    pub entry_price: f64,
    pub stop_loss: Option < f64 >,
    pub take_profit: Option < f64 >,
};
}

pub struct PendingOrder

#![allow(unused)]
fn main() {
pub struct PendingOrder {
    pub client_id: String,
    pub order: Order,
    pub status: PendingStatus,
    pub placed_at: Instant,
    pub last_update: Instant,
    pub filled_qty: f64,
    pub avg_price: f64,
};
}

pub struct OrderManager

#![allow(unused)]
fn main() {
pub struct OrderManager {
    pub orders: HashMap < String , PendingOrder >,
    pub exchange_to_client: HashMap < String , String >,
};
}

Enums

pub enum PendingStatus

#![allow(unused)]
fn main() {
pub enum PendingStatus {
    Waiting,
    Placed(order_id: String,),
    PartiallyFilled(order_id: String,
    filled_qty: f64,),
    CancelRequested(order_id: String,),
    SubmissionUnknown(error: String,),
    Filled,
    Cancelled,
    Failed(String,),
}
}