sandbox_quant/model/tick.rs
1#[derive(Debug, Clone)]
2pub struct Tick {
3 pub symbol: String,
4 pub price: f64,
5 pub qty: f64,
6 pub timestamp_ms: u64,
7 pub is_buyer_maker: bool,
8 pub trade_id: u64,
9}
10
11impl Tick {
12 /// Create a synthetic tick from a kline close price (for SMA warm-up).
13 pub fn from_price(price: f64) -> Self {
14 Self {
15 symbol: "SYNTH".to_string(),
16 price,
17 qty: 0.0,
18 timestamp_ms: 0,
19 is_buyer_maker: false,
20 trade_id: 0,
21 }
22 }
23}