Skip to main content

sandbox_quant/model/
tick.rs

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