From b8e0d3bf4cad1aaa204321e7d304bedceaaa85ec Mon Sep 17 00:00:00 2001 From: boris Date: Mon, 7 Sep 2026 02:28:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=9B=98=E4=B8=AD=E6=94=B6?= =?UTF-8?q?=E7=9B=98=E6=92=AE=E5=90=88=E7=9B=98=E5=8F=A3=E9=99=90=E5=88=B6?= =?UTF-8?q?=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fidc-core/src/platform_strategy_spec.rs | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/crates/fidc-core/src/platform_strategy_spec.rs b/crates/fidc-core/src/platform_strategy_spec.rs index 0b749cc..3ba3d67 100644 --- a/crates/fidc-core/src/platform_strategy_spec.rs +++ b/crates/fidc-core/src/platform_strategy_spec.rs @@ -1337,7 +1337,13 @@ fn apply_flat_risk_overrides( fn sync_quote_quantity_limit(cfg: &mut PlatformExprStrategyConfig) { cfg.quote_quantity_limit = cfg.risk_config.trading_constraints.liquidity_limit_enabled - || cfg.matching_type != MatchingType::MinuteLast; + || matches!( + cfg.matching_type, + MatchingType::MinuteBestOwn + | MatchingType::MinuteBestCounterparty + | MatchingType::Vwap + | MatchingType::Twap + ); } fn apply_risk_policy_overrides( @@ -3685,6 +3691,24 @@ mod tests { assert!(!cfg.quote_quantity_limit); } + #[test] + fn current_close_respects_explicitly_disabled_liquidity_limit() { + let spec = serde_json::json!({ + "execution": { + "matchingType": "current_bar_close", + "volumeLimit": true, + "liquidityLimit": false, + "volumePercent": 0.25 + } + }); + + let cfg = platform_expr_config_from_value("", "", &spec).expect("config"); + + assert!(cfg.risk_config.trading_constraints.volume_limit_enabled); + assert!(!cfg.risk_config.trading_constraints.liquidity_limit_enabled); + assert!(!cfg.quote_quantity_limit); + } + #[test] fn parses_st_and_star_st_risk_policy_switches_into_platform_config() { let spec = serde_json::json!({