From 74105f0fde7fb000b4e6565253e523443b0b7735 Mon Sep 17 00:00:00 2001 From: boris Date: Sun, 5 Jul 2026 22:59:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E7=BA=BF=E6=8A=95?= =?UTF-8?q?=E5=BD=B1=E6=88=90=E4=BA=A4=E9=87=8F=E9=99=90=E5=88=B6=E5=9F=BA?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/fidc-core/src/platform_expr_strategy.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/fidc-core/src/platform_expr_strategy.rs b/crates/fidc-core/src/platform_expr_strategy.rs index bee75ad..dbc7860 100644 --- a/crates/fidc-core/src/platform_expr_strategy.rs +++ b/crates/fidc-core/src/platform_expr_strategy.rs @@ -1573,7 +1573,12 @@ impl PlatformExprStrategy { } if constraints.volume_limit_enabled { - if market.minute_volume == 0 { + let volume_basis = match quote { + Some(quote) => quote.volume_delta, + None if market.minute_volume > 0 => market.minute_volume, + None => market.volume, + }; + if volume_basis == 0 { return None; } let consumed_turnover = execution_state @@ -1582,8 +1587,7 @@ impl PlatformExprStrategy { .copied() .unwrap_or(0) .saturating_add(current_fill_quantity); - let raw_limit = ((market.minute_volume as f64) * constraints.volume_percent).floor() - as i64 + let raw_limit = ((volume_basis as f64) * constraints.volume_percent).floor() as i64 - consumed_turnover as i64; if raw_limit <= 0 { return None; @@ -9558,7 +9562,7 @@ mod tests { ask1: last_price, prev_close: 10.0, volume: 1_000_000, - minute_volume: 10_000, + minute_volume: 0, bid1_volume: 10_000, ask1_volume: 10_000, trading_phase: Some("continuous".to_string()),