From 3fa1004ec59f7cb40c929a9a46c1aec6bed9800c Mon Sep 17 00:00:00 2001 From: boris Date: Thu, 10 Sep 2026 14:46:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=A1=E6=AD=A3=E5=B0=81=E6=9D=BF=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E7=8E=87=E4=B8=BA=E5=B0=81=E6=9D=BF=E5=AE=B6=E6=95=B0?= =?UTF-8?q?=E9=99=A4=E4=BB=A5=E8=A7=A6=E6=9D=BF=E5=AE=B6=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/fidc-core/src/market_event_context.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/fidc-core/src/market_event_context.rs b/crates/fidc-core/src/market_event_context.rs index 32b7b51..29cbff5 100644 --- a/crates/fidc-core/src/market_event_context.rs +++ b/crates/fidc-core/src/market_event_context.rs @@ -164,7 +164,7 @@ pub fn aggregate(request: Request) -> Result { ("market_return".into(), Some(average(returns.values().copied(), active))), ("market_limit_up_count".into(), Some(ups.len() as f64)), ("market_limit_down_count".into(), Some(downs as f64)), - ("market_limit_up_rate".into(), (active > unlimited).then(|| ups.len() as f64 / (active - unlimited) as f64)), + ("market_limit_up_rate".into(), (touched > 0).then(|| ups.len() as f64 / touched as f64)), ("market_broken_limit_rate".into(), (touched > 0).then(|| broken as f64 / touched as f64)), ("market_high_board".into(), board), ("market_profit_effect".into(), profit), @@ -221,6 +221,8 @@ mod tests { let d=&r.days[1]; assert_eq!(d.common["market_breadth"],Some(0.5)); assert_eq!(d.common["market_limit_down_count"],Some(1.0)); + assert_eq!(d.common["market_limit_up_rate"],Some(1.0)); + assert_eq!(r.days[0].common["market_limit_up_rate"],Some(0.0)); assert_eq!(r.days[0].common["market_broken_limit_rate"],Some(1.0)); assert_eq!(r.days[2].common["market_high_board"],Some(2.0)); assert!((r.days[2].common["market_profit_effect"].unwrap()-0.1).abs()<1e-12);