ek-data 0.2.8

Trading data contracts for the enkeep ek ecosystem: venue enums, zero-dep epoch-nanosecond time, decimal-exact price rounding, vt-symbol convention, bus event dictionary, tick/bar/order/trade/position/account/contract objects and request objects (Python enkeep_trade trader/object.py + constant.py, faithfully ported).
Documentation
//! 历史数据查询请求(`object.py:607-621`)。

use crate::constant::{Exchange, Interval};
use crate::time::DtNs;

/// 发往网关的历史数据请求。
#[derive(Debug, Clone, PartialEq, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct HistoryRequest {
    /// 合约代码
    pub symbol: String,
    /// 交易所
    pub exchange: Exchange,
    /// 起点(UTC 纪元纳秒)
    pub start: DtNs,
    /// 终点(缺省 None)
    pub end: Option<DtNs>,
    /// K 线间隔(缺省 None)
    pub interval: Option<Interval>,
}

impl HistoryRequest {
    /// `en_symbol`(派生方法)。
    pub fn en_symbol(&self) -> String {
        crate::symbol::vt_symbol(&self.symbol, self.exchange)
    }
}