rt_hft_engine/
order_book.rs1#[derive(Debug, Clone)]
4pub enum OrderSide {
5 Buy,
6 Sell,
7}
8
9#[derive(Debug, Clone)]
10pub enum OrderType {
11 Market,
12 Limit,
13}
14
15#[derive(Debug, Clone)]
16pub struct Order {
17 pub id: String,
18 pub symbol: String,
19 pub side: OrderSide,
20 pub order_type: OrderType,
21 pub quantity: u64,
22 pub price: f64,
23}
24
25impl Order {
26 pub fn new(id: String, symbol: String, side: OrderSide, order_type: OrderType, quantity: u64, price: f64) -> Self {
27 Self { id, symbol, side, order_type, quantity, price }
28 }
29}
30
31
32#[allow(dead_code)]
33pub struct OrderBook {
34 symbol: String,
35}
36
37impl OrderBook {
38 pub fn new(symbol: String) -> Self {
39 Self { symbol }
40 }
41}