finance_query/models/chart/
candle.rs

1/// Candle module
2///
3/// Contains the OHLCV candle/bar structure.
4use serde::{Deserialize, Serialize};
5
6/// A single OHLCV candle/bar
7///
8/// Note: This struct cannot be manually constructed - obtain via `Ticker::chart()`.
9#[non_exhaustive]
10#[derive(Debug, Clone, Serialize, Deserialize)]
11#[cfg_attr(feature = "dataframe", derive(crate::ToDataFrame))]
12pub struct Candle {
13    /// Timestamp (Unix)
14    pub timestamp: i64,
15    /// Open price
16    pub open: f64,
17    /// High price
18    pub high: f64,
19    /// Low price
20    pub low: f64,
21    /// Close price
22    pub close: f64,
23    /// Volume
24    pub volume: i64,
25    /// Adjusted close (if available)
26    pub adj_close: Option<f64>,
27}