切换分钟执行价语义

This commit is contained in:
boris
2026-06-26 09:27:21 +08:00
parent 02e2a20aff
commit 6db480b91d
7 changed files with 48 additions and 33 deletions
+4 -5
View File
@@ -1598,7 +1598,7 @@ impl DataSet {
}
match normalize_history_frequency(frequency).as_deref() {
Some("1d") => self.history_daily_values(date, symbol, bar_count, field, include_now),
Some("1m") | Some("tick") => self.history_intraday_values(
Some("1m") => self.history_intraday_values(
date,
active_datetime,
symbol,
@@ -2143,7 +2143,7 @@ impl DataSet {
.map(Arc::as_ref)
.map(daily_market_price_bar)
.collect(),
Some("1m") | Some("tick") => {
Some("1m") => {
let mut bars = self
.execution_quotes_by_date
.iter()
@@ -3042,7 +3042,7 @@ fn intraday_quote_price_bar(snapshot: &IntradayExecutionQuote) -> PriceBar {
date: snapshot.date,
timestamp: Some(snapshot.timestamp.format("%Y-%m-%d %H:%M:%S").to_string()),
symbol: snapshot.symbol.clone(),
frequency: "tick".to_string(),
frequency: "1m".to_string(),
open: snapshot.last_price,
high: snapshot.last_price,
low: snapshot.last_price,
@@ -3090,8 +3090,7 @@ fn normalize_history_frequency(frequency: &str) -> Option<String> {
let normalized = normalize_field(frequency);
match normalized.as_str() {
"1d" | "d" | "day" | "daily" => Some("1d".to_string()),
"1m" | "m" | "minute" | "min" => Some("1m".to_string()),
"tick" | "t" => Some("tick".to_string()),
"1m" | "m" | "minute" | "min" | "tick" | "t" => Some("1m".to_string()),
_ => None,
}
}