From bfbbac8952ea858930e372a4859a65943c9c6142 Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 8 Jul 2026 05:24:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3AiQuant=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E9=80=80=E5=87=BA=E6=A7=BD=E4=BD=8D=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E8=AF=AD=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fidc-core/src/platform_strategy_spec.rs | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/crates/fidc-core/src/platform_strategy_spec.rs b/crates/fidc-core/src/platform_strategy_spec.rs index a255472..830091d 100644 --- a/crates/fidc-core/src/platform_strategy_spec.rs +++ b/crates/fidc-core/src/platform_strategy_spec.rs @@ -1793,6 +1793,12 @@ pub fn platform_expr_config_from_spec( { cfg.retry_empty_rebalance = true; } + if trading + .and_then(|item| item.release_slot_on_exit_signal) + .is_none() + { + cfg.release_slot_on_exit_signal = true; + } } let trade_times = spec_trade_times(spec); if let Some(main_trade_time) = trade_times.last().copied() { @@ -3087,6 +3093,51 @@ mod tests { ); } + #[test] + fn aiquant_compatibility_defaults_release_slot_on_exit_signal() { + let spec = serde_json::json!({ + "engineConfig": { + "profileName": "cn_a_microcap_v1", + "compatibilityProfile": "aiquant_rqalpha" + }, + "runtimeExpressions": { + "trading": { + "dailyTopUp": true + } + } + }); + + let cfg = platform_expr_config_from_value("", "", &spec).expect("config"); + + assert!( + cfg.release_slot_on_exit_signal, + "AiQuant compatibility must release the strategy working slot when an exit signal is emitted" + ); + } + + #[test] + fn aiquant_compatibility_respects_explicit_release_slot_false() { + let spec = serde_json::json!({ + "engineConfig": { + "profileName": "cn_a_microcap_v1", + "compatibilityProfile": "aiquant_rqalpha" + }, + "runtimeExpressions": { + "trading": { + "dailyTopUp": true, + "releaseSlotOnExitSignal": false + } + } + }); + + let cfg = platform_expr_config_from_value("", "", &spec).expect("config"); + + assert!( + !cfg.release_slot_on_exit_signal, + "explicit FIDC semantics must override the AiQuant compatibility default" + ); + } + #[test] fn parses_explicit_delayed_limit_open_exit() { let spec = serde_json::json!({