Skip to main content

parse_daily_to_structs

Function parse_daily_to_structs 

Source
pub fn parse_daily_to_structs(
    path: impl AsRef<Path>,
    start_date_str: &str,
    end_date_str: &str,
) -> Result<Vec<DailyKlineData>, DailyParseError>
Expand description

按字符串日期范围解析日线文件为结构体。

start_date_strend_date_str 必须使用 YYYYMMDD 格式。

§Examples

use qmt_parser::parse_daily_to_structs;

let rows = parse_daily_to_structs("data/day/000001.dat", "20230101", "20231231")?;
println!("rows = {}", rows.len());