From 1d33b29c27f10b96c6454e496c5bc4d4d730c55c Mon Sep 17 00:00:00 2001 From: boris Date: Mon, 6 Jul 2026 09:40:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=A3=E8=8A=82=E6=80=A7?= =?UTF-8?q?=E6=B8=85=E4=BB=93=E6=89=A7=E8=A1=8C=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fidc-core/src/platform_expr_strategy.rs | 23 +++++++++++++++---- crates/fidc-core/src/strategy.rs | 5 +++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/crates/fidc-core/src/platform_expr_strategy.rs b/crates/fidc-core/src/platform_expr_strategy.rs index 8bfbd59..1c7076f 100644 --- a/crates/fidc-core/src/platform_expr_strategy.rs +++ b/crates/fidc-core/src/platform_expr_strategy.rs @@ -7978,9 +7978,12 @@ impl Strategy for PlatformExprStrategy { continue; } exit_symbols.insert(symbol.clone()); - order_intents.push(OrderIntent::TargetValue { + order_intents.push(OrderIntent::TimedTargetValue { symbol: symbol.clone(), target_value: 0.0, + style: AlgoOrderStyle::Twap, + start_time: Some(delayed_limit_exit_time), + end_time: Some(delayed_limit_exit_time), reason: "seasonal_stop_window".to_string(), }); self.forget_position_entry_date(symbol); @@ -11950,12 +11953,17 @@ mod tests { assert!( decision.order_intents.iter().any(|intent| matches!( intent, - OrderIntent::TargetValue { + OrderIntent::TimedTargetValue { symbol, target_value, + start_time, + end_time, reason, + .. } if symbol == other_symbol && *target_value == 0.0 + && *start_time == Some(NaiveTime::from_hms_opt(9, 31, 0).unwrap()) + && *end_time == Some(NaiveTime::from_hms_opt(9, 31, 0).unwrap()) && reason == "seasonal_stop_window" )), "{:?}", @@ -11964,7 +11972,7 @@ mod tests { assert!( !decision.order_intents.iter().any(|intent| matches!( intent, - OrderIntent::TargetValue { + OrderIntent::TimedTargetValue { symbol, reason, .. @@ -12227,7 +12235,7 @@ mod tests { assert!( !decision.order_intents.iter().any(|intent| matches!( intent, - OrderIntent::TargetValue { + OrderIntent::TimedTargetValue { symbol, reason, .. @@ -12239,12 +12247,17 @@ mod tests { assert!( decision.order_intents.iter().any(|intent| matches!( intent, - OrderIntent::TargetValue { + OrderIntent::TimedTargetValue { symbol, target_value, + start_time, + end_time, reason, + .. } if symbol == other_symbol && *target_value == 0.0 + && *start_time == Some(NaiveTime::from_hms_opt(9, 31, 0).unwrap()) + && *end_time == Some(NaiveTime::from_hms_opt(9, 31, 0).unwrap()) && reason == "seasonal_stop_window" )), "{:?}", diff --git a/crates/fidc-core/src/strategy.rs b/crates/fidc-core/src/strategy.rs index 7c97e51..361c2c4 100644 --- a/crates/fidc-core/src/strategy.rs +++ b/crates/fidc-core/src/strategy.rs @@ -2622,9 +2622,12 @@ impl Strategy for OmniMicroCapStrategy { .positions() .keys() .cloned() - .map(|symbol| OrderIntent::TargetValue { + .map(|symbol| OrderIntent::TimedTargetValue { symbol, target_value: 0.0, + style: AlgoOrderStyle::Twap, + start_time: Some(self.intraday_execution_start_time()), + end_time: Some(self.intraday_execution_start_time()), reason: "seasonal_stop_window".to_string(), }) .collect(),