perf(data): compact immutable snapshots with current execution rules

This commit is contained in:
boris
2026-09-12 16:02:24 +08:00
parent ffd23b9920
commit 828690a51e
22 changed files with 1430 additions and 1058 deletions
+95 -95
View File
@@ -49,7 +49,7 @@ fn single_day_anchor_data(date: NaiveDate) -> DataSet {
}],
vec![DailyMarketSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-02 10:18:00".to_string()),
day_open: 10.0,
open: 10.0,
@@ -72,18 +72,18 @@ fn single_day_anchor_data(date: NaiveDate) -> DataSet {
}],
vec![DailyFactorSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 100.0,
free_float_cap_bn: 80.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
}],
vec![CandidateEligibility {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -109,7 +109,7 @@ fn single_day_anchor_data(date: NaiveDate) -> DataSet {
fn market_row(date: NaiveDate, symbol: &str, open: f64, close: f64) -> DailyMarketSnapshot {
DailyMarketSnapshot {
date,
symbol: symbol.to_string(),
symbol: symbol.into(),
timestamp: Some(format!("{date} 10:18:00")),
day_open: open,
open,
@@ -139,7 +139,7 @@ fn factor_row(
) -> DailyFactorSnapshot {
DailyFactorSnapshot {
date,
symbol: symbol.to_string(),
symbol: symbol.into(),
market_cap_bn: 100.0,
free_float_cap_bn: 80.0,
pe_ttm: 10.0,
@@ -153,7 +153,7 @@ fn factor_row(
fn candidate_row(date: NaiveDate, symbol: &str) -> CandidateEligibility {
CandidateEligibility {
date,
symbol: symbol.to_string(),
symbol: symbol.into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -219,7 +219,7 @@ fn two_day_futures_data() -> DataSet {
("stock_connect_north_bound".into(), 1.0),
("industry_citics_l1".into(), 10.0),
("fundamental_net_profit".into(), 99.0),
]),
]).into(),
),
factor_row(
d2,
@@ -232,7 +232,7 @@ fn two_day_futures_data() -> DataSet {
("stock_connect_north_bound".into(), 1.0),
("industry_citics_l1".into(), 10.0),
("fundamental_net_profit".into(), 101.0),
]),
]).into(),
),
],
vec![
@@ -1094,7 +1094,7 @@ fn engine_runs_strategy_hooks_in_daily_order() {
vec![
DailyMarketSnapshot {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-02 10:18:00".to_string()),
day_open: 10.0,
open: 10.0,
@@ -1117,7 +1117,7 @@ fn engine_runs_strategy_hooks_in_daily_order() {
},
DailyMarketSnapshot {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-03 10:18:00".to_string()),
day_open: 10.1,
open: 10.1,
@@ -1142,31 +1142,31 @@ fn engine_runs_strategy_hooks_in_daily_order() {
vec![
DailyFactorSnapshot {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 20.0,
free_float_cap_bn: 18.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
},
DailyFactorSnapshot {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 21.0,
free_float_cap_bn: 19.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
},
],
vec![
CandidateEligibility {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -1179,7 +1179,7 @@ fn engine_runs_strategy_hooks_in_daily_order() {
},
CandidateEligibility {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -1337,7 +1337,7 @@ fn engine_executes_open_auction_decisions_before_on_day() {
}],
vec![DailyMarketSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-02 09:25:00".to_string()),
day_open: 10.0,
open: 10.0,
@@ -1360,18 +1360,18 @@ fn engine_executes_open_auction_decisions_before_on_day() {
}],
vec![DailyFactorSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 20.0,
free_float_cap_bn: 18.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
}],
vec![CandidateEligibility {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -1438,7 +1438,7 @@ fn engine_executes_futures_order_intents_against_future_account() {
}],
vec![DailyMarketSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-02 10:18:00".to_string()),
day_open: 10.0,
open: 10.0,
@@ -1461,18 +1461,18 @@ fn engine_executes_futures_order_intents_against_future_account() {
}],
vec![DailyFactorSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 100.0,
free_float_cap_bn: 80.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
}],
vec![CandidateEligibility {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -1935,7 +1935,7 @@ fn engine_rejects_futures_orders_when_trading_phase_is_closed() {
},
],
vec![market_row(date, "000001.SZ", 10.0, 10.0), future_market],
vec![factor_row(date, "000001.SZ", BTreeMap::new())],
vec![factor_row(date, "000001.SZ", BTreeMap::new().into())],
vec![candidate_row(date, "000001.SZ")],
vec![benchmark_row(date)],
Vec::new(),
@@ -2011,7 +2011,7 @@ fn engine_sweeps_futures_order_book_depth_when_available() {
market_row(date, "000001.SZ", 10.0, 10.0),
market_row(date, "IF2501", 4000.0, 4000.0),
],
vec![factor_row(date, "000001.SZ", BTreeMap::new())],
vec![factor_row(date, "000001.SZ", BTreeMap::new().into())],
vec![candidate_row(date, "000001.SZ")],
vec![benchmark_row(date)],
Vec::new(),
@@ -2154,7 +2154,7 @@ fn engine_runs_minute_hooks_and_executes_minute_orders() {
}).collect(),
vec![DailyMarketSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-02 10:18:00".to_string()),
day_open: 10.0,
open: 10.0,
@@ -2177,18 +2177,18 @@ fn engine_runs_minute_hooks_and_executes_minute_orders() {
}, market_row(date, "000002.SZ", 20.0, 20.4)],
vec![DailyFactorSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 20.0,
free_float_cap_bn: 18.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
}],
vec![CandidateEligibility {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -2446,7 +2446,7 @@ fn strategy_context_exposes_engine_native_data_helpers() {
.map(
|(date, open, close, prev_close, volume)| DailyMarketSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some(format!("{date} 10:18:00")),
day_open: open,
open,
@@ -2473,14 +2473,14 @@ fn strategy_context_exposes_engine_native_data_helpers() {
.into_iter()
.map(|date| DailyFactorSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 20.0,
free_float_cap_bn: 18.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
})
.collect::<Vec<_>>();
let candidates = [
@@ -2491,7 +2491,7 @@ fn strategy_context_exposes_engine_native_data_helpers() {
.into_iter()
.map(|(date, is_paused, is_st)| CandidateEligibility {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st,
is_star_st: false,
is_new_listing: false,
@@ -2619,7 +2619,7 @@ fn strategy_context_exposes_final_order_runtime_view() {
}],
vec![DailyMarketSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-02 10:18:00".to_string()),
day_open: 10.0,
open: 10.0,
@@ -2642,18 +2642,18 @@ fn strategy_context_exposes_final_order_runtime_view() {
}],
vec![DailyFactorSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 20.0,
free_float_cap_bn: 18.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
}],
vec![CandidateEligibility {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -2838,7 +2838,7 @@ fn engine_applies_account_cash_flow_and_financing_intents() {
vec![
DailyMarketSnapshot {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-02 10:18:00".to_string()),
day_open: 10.0,
open: 10.0,
@@ -2861,7 +2861,7 @@ fn engine_applies_account_cash_flow_and_financing_intents() {
},
DailyMarketSnapshot {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-03 10:18:00".to_string()),
day_open: 10.0,
open: 10.0,
@@ -2886,31 +2886,31 @@ fn engine_applies_account_cash_flow_and_financing_intents() {
vec![
DailyFactorSnapshot {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 20.0,
free_float_cap_bn: 18.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
},
DailyFactorSnapshot {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 20.0,
free_float_cap_bn: 18.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
},
],
vec![
CandidateEligibility {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -2923,7 +2923,7 @@ fn engine_applies_account_cash_flow_and_financing_intents() {
},
CandidateEligibility {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -3035,7 +3035,7 @@ fn engine_expires_pending_day_limit_orders_at_market_close() {
vec![
DailyMarketSnapshot {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-02 10:18:00".to_string()),
day_open: 10.0,
open: 10.0,
@@ -3058,7 +3058,7 @@ fn engine_expires_pending_day_limit_orders_at_market_close() {
},
DailyMarketSnapshot {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-03 10:18:00".to_string()),
day_open: 9.7,
open: 9.7,
@@ -3083,31 +3083,31 @@ fn engine_expires_pending_day_limit_orders_at_market_close() {
vec![
DailyFactorSnapshot {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 20.0,
free_float_cap_bn: 18.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
},
DailyFactorSnapshot {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 21.0,
free_float_cap_bn: 19.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
},
],
vec![
CandidateEligibility {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -3120,7 +3120,7 @@ fn engine_expires_pending_day_limit_orders_at_market_close() {
},
CandidateEligibility {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -3211,7 +3211,7 @@ fn engine_runs_scheduled_rules_for_daily_weekly_and_monthly_triggers() {
vec![
DailyMarketSnapshot {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-30 09:25:00".to_string()),
day_open: 10.0,
open: 10.0,
@@ -3234,7 +3234,7 @@ fn engine_runs_scheduled_rules_for_daily_weekly_and_monthly_triggers() {
},
DailyMarketSnapshot {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-31 09:25:00".to_string()),
day_open: 10.1,
open: 10.1,
@@ -3257,7 +3257,7 @@ fn engine_runs_scheduled_rules_for_daily_weekly_and_monthly_triggers() {
},
DailyMarketSnapshot {
date: date3,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-02-03 09:25:00".to_string()),
day_open: 10.2,
open: 10.2,
@@ -3282,42 +3282,42 @@ fn engine_runs_scheduled_rules_for_daily_weekly_and_monthly_triggers() {
vec![
DailyFactorSnapshot {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 20.0,
free_float_cap_bn: 18.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
},
DailyFactorSnapshot {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 21.0,
free_float_cap_bn: 19.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
},
DailyFactorSnapshot {
date: date3,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 22.0,
free_float_cap_bn: 20.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
},
],
vec![
CandidateEligibility {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -3330,7 +3330,7 @@ fn engine_runs_scheduled_rules_for_daily_weekly_and_monthly_triggers() {
},
CandidateEligibility {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -3343,7 +3343,7 @@ fn engine_runs_scheduled_rules_for_daily_weekly_and_monthly_triggers() {
},
CandidateEligibility {
date: date3,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -3469,7 +3469,7 @@ fn engine_dispatches_process_events_to_external_bus_listeners() {
vec![
DailyMarketSnapshot {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-30 09:25:00".to_string()),
day_open: 10.0,
open: 10.0,
@@ -3492,7 +3492,7 @@ fn engine_dispatches_process_events_to_external_bus_listeners() {
},
DailyMarketSnapshot {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-31 09:25:00".to_string()),
day_open: 10.1,
open: 10.1,
@@ -3515,7 +3515,7 @@ fn engine_dispatches_process_events_to_external_bus_listeners() {
},
DailyMarketSnapshot {
date: date3,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-02-03 09:25:00".to_string()),
day_open: 10.2,
open: 10.2,
@@ -3540,42 +3540,42 @@ fn engine_dispatches_process_events_to_external_bus_listeners() {
vec![
DailyFactorSnapshot {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 20.0,
free_float_cap_bn: 18.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
},
DailyFactorSnapshot {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 21.0,
free_float_cap_bn: 19.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
},
DailyFactorSnapshot {
date: date3,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 22.0,
free_float_cap_bn: 20.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
},
],
vec![
CandidateEligibility {
date: date1,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -3588,7 +3588,7 @@ fn engine_dispatches_process_events_to_external_bus_listeners() {
},
CandidateEligibility {
date: date2,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -3601,7 +3601,7 @@ fn engine_dispatches_process_events_to_external_bus_listeners() {
},
CandidateEligibility {
date: date3,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -3855,7 +3855,7 @@ fn engine_applies_dynamic_universe_and_subscription_directives() {
[
DailyMarketSnapshot {
date: *date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some(format!("{date} 10:18:00")),
day_open: 10.0,
open: 10.0,
@@ -3878,7 +3878,7 @@ fn engine_applies_dynamic_universe_and_subscription_directives() {
},
DailyMarketSnapshot {
date: *date,
symbol: "000002.SZ".to_string(),
symbol: "000002.SZ".into(),
timestamp: Some(format!("{date} 10:18:00")),
day_open: 20.0,
open: 20.0,
@@ -3908,25 +3908,25 @@ fn engine_applies_dynamic_universe_and_subscription_directives() {
[
DailyFactorSnapshot {
date: *date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 10.0,
free_float_cap_bn: 8.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
},
DailyFactorSnapshot {
date: *date,
symbol: "000002.SZ".to_string(),
symbol: "000002.SZ".into(),
market_cap_bn: 12.0,
free_float_cap_bn: 10.0,
pe_ttm: 12.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
},
]
})
@@ -3937,7 +3937,7 @@ fn engine_applies_dynamic_universe_and_subscription_directives() {
[
CandidateEligibility {
date: *date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -3950,7 +3950,7 @@ fn engine_applies_dynamic_universe_and_subscription_directives() {
},
CandidateEligibility {
date: *date,
symbol: "000002.SZ".to_string(),
symbol: "000002.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -4041,7 +4041,7 @@ fn engine_exposes_current_process_context_to_strategies() {
}],
vec![DailyMarketSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-02 10:18:00".to_string()),
day_open: 10.0,
open: 10.0,
@@ -4064,18 +4064,18 @@ fn engine_exposes_current_process_context_to_strategies() {
}],
vec![DailyFactorSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
market_cap_bn: 20.0,
free_float_cap_bn: 18.0,
pe_ttm: 10.0,
turnover_ratio: Some(1.0),
effective_turnover_ratio: Some(1.0),
adjustment_factor_backward1: None,
extra_factors: BTreeMap::new(),
extra_factors: Default::default(),
}],
vec![CandidateEligibility {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -4191,8 +4191,8 @@ fn engine_rejects_an_unexplained_missing_holding_close() {
market_row(date2, "000001.SZ", 20.0, 20.2),
],
vec![
factor_row(date1, "601028.SH", BTreeMap::new()),
factor_row(date2, "000001.SZ", BTreeMap::new()),
factor_row(date1, "601028.SH", BTreeMap::new().into()),
factor_row(date2, "000001.SZ", BTreeMap::new().into()),
],
vec![
candidate_row(date1, "601028.SH"),
@@ -4269,8 +4269,8 @@ fn platform_strategy_cannot_hide_missing_valuation_by_skipping_stop_take() {
market_row(date2, "000001.SZ", 20.0, 20.2),
],
vec![
factor_row(date1, "601028.SH", BTreeMap::new()),
factor_row(date2, "000001.SZ", BTreeMap::new()),
factor_row(date1, "601028.SH", BTreeMap::new().into()),
factor_row(date2, "000001.SZ", BTreeMap::new().into()),
],
vec![
candidate_row(date1, "601028.SH"),