拆分ST与星号ST风控语义

This commit is contained in:
boris
2026-07-03 09:00:50 +08:00
parent c32926cc34
commit 3bb001c374
17 changed files with 308 additions and 36 deletions
+1
View File
@@ -17,6 +17,7 @@ fn candidate() -> CandidateEligibility {
date: d(2024, 1, 3),
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -137,6 +137,7 @@ fn stock_candidate(date: NaiveDate) -> CandidateEligibility {
date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -281,6 +282,7 @@ fn engine_reinvests_dividend_receivable_in_round_lots() {
date: buy_date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -293,6 +295,7 @@ fn engine_reinvests_dividend_receivable_in_round_lots() {
date: ex_date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -305,6 +308,7 @@ fn engine_reinvests_dividend_receivable_in_round_lots() {
date: payable_date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -143,6 +143,7 @@ fn engine_preloads_declared_decision_quotes_for_current_positions() {
date: first,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -155,6 +156,7 @@ fn engine_preloads_declared_decision_quotes_for_current_positions() {
date: second,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -309,6 +311,7 @@ fn engine_reuses_preloaded_decision_quotes_without_loader_call() {
date: first,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -321,6 +324,7 @@ fn engine_reuses_preloaded_decision_quotes_without_loader_call() {
date: second,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -540,6 +544,7 @@ fn engine_loads_distinct_decision_quote_times_on_same_day() {
date: first,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -552,6 +557,7 @@ fn engine_loads_distinct_decision_quote_times_on_same_day() {
date: second,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
+6
View File
@@ -175,6 +175,7 @@ fn engine_settles_delisted_position_before_missing_market_snapshot_breaks_run()
date: date1,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -187,6 +188,7 @@ fn engine_settles_delisted_position_before_missing_market_snapshot_breaks_run()
date: date1,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -199,6 +201,7 @@ fn engine_settles_delisted_position_before_missing_market_snapshot_breaks_run()
date: date2,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -398,6 +401,7 @@ fn engine_applies_successor_conversion_before_delisted_cash_settlement() {
date: date1,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -410,6 +414,7 @@ fn engine_applies_successor_conversion_before_delisted_cash_settlement() {
date: date1,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -422,6 +427,7 @@ fn engine_applies_successor_conversion_before_delisted_cash_settlement() {
date: date2,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
+22
View File
@@ -81,6 +81,7 @@ fn single_day_anchor_data(date: NaiveDate) -> DataSet {
date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -149,6 +150,7 @@ fn candidate_row(date: NaiveDate, symbol: &str) -> CandidateEligibility {
date,
symbol: symbol.to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -1125,6 +1127,7 @@ fn engine_runs_strategy_hooks_in_daily_order() {
date: date1,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -1137,6 +1140,7 @@ fn engine_runs_strategy_hooks_in_daily_order() {
date: date2,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -1284,6 +1288,7 @@ fn engine_executes_open_auction_decisions_before_on_day() {
date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -1383,6 +1388,7 @@ fn engine_executes_futures_order_intents_against_future_account() {
date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -1973,6 +1979,7 @@ fn engine_runs_minute_hooks_and_executes_minute_orders() {
date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2157,6 +2164,7 @@ fn strategy_context_exposes_engine_native_data_helpers() {
date,
symbol: "000001.SZ".to_string(),
is_st,
is_star_st: false,
is_new_listing: false,
is_paused,
allow_buy: true,
@@ -2317,6 +2325,7 @@ fn strategy_context_exposes_final_order_runtime_view() {
date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2571,6 +2580,7 @@ fn engine_applies_account_cash_flow_and_financing_intents() {
date: date1,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2583,6 +2593,7 @@ fn engine_applies_account_cash_flow_and_financing_intents() {
date: date2,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2755,6 +2766,7 @@ fn engine_rejects_pending_limit_orders_at_market_close() {
date: date1,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2767,6 +2779,7 @@ fn engine_rejects_pending_limit_orders_at_market_close() {
date: date2,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2958,6 +2971,7 @@ fn engine_runs_scheduled_rules_for_daily_weekly_and_monthly_triggers() {
date: date1,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2970,6 +2984,7 @@ fn engine_runs_scheduled_rules_for_daily_weekly_and_monthly_triggers() {
date: date2,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2982,6 +2997,7 @@ fn engine_runs_scheduled_rules_for_daily_weekly_and_monthly_triggers() {
date: date3,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3207,6 +3223,7 @@ fn engine_dispatches_process_events_to_external_bus_listeners() {
date: date1,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3219,6 +3236,7 @@ fn engine_dispatches_process_events_to_external_bus_listeners() {
date: date2,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3231,6 +3249,7 @@ fn engine_dispatches_process_events_to_external_bus_listeners() {
date: date3,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3564,6 +3583,7 @@ fn engine_applies_dynamic_universe_and_subscription_directives() {
date: *date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3576,6 +3596,7 @@ fn engine_applies_dynamic_universe_and_subscription_directives() {
date: *date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3699,6 +3720,7 @@ fn engine_exposes_current_process_context_to_strategies() {
date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -56,6 +56,7 @@ fn order_value_rounding_data(date: NaiveDate, symbol: &str, price: f64) -> DataS
date,
symbol: symbol.to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -166,6 +167,7 @@ fn single_symbol_limit_price_data(
date,
symbol: symbol.to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -236,6 +238,7 @@ fn broker_executes_explicit_order_value_buy() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -387,6 +390,7 @@ fn broker_delayed_limit_open_sell_uses_minute_price() {
date,
symbol: symbol.to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -520,6 +524,7 @@ fn broker_executes_order_shares_and_order_lots() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -647,6 +652,7 @@ fn broker_executes_target_shares_like_order_to() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_kcb: false,
is_paused: false,
@@ -805,6 +811,7 @@ fn broker_executes_target_portfolio_smart_with_custom_prices() {
date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -817,6 +824,7 @@ fn broker_executes_target_portfolio_smart_with_custom_prices() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -949,6 +957,7 @@ fn broker_executes_target_portfolio_smart_with_algo_order_style() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -1091,6 +1100,7 @@ fn broker_executes_order_percent_and_target_percent() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -1214,6 +1224,7 @@ fn broker_uses_day_open_price_for_open_auction_matching() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -1319,6 +1330,7 @@ fn broker_open_auction_uses_auction_volume_without_quote_liquidity() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -1421,6 +1433,7 @@ fn broker_cancels_buy_when_open_hits_upper_limit() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -1535,6 +1548,7 @@ fn broker_applies_price_ratio_slippage_on_snapshot_fills() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -1636,6 +1650,7 @@ fn broker_applies_dynamic_slippage_on_snapshot_fills() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -1742,6 +1757,7 @@ fn broker_applies_tick_size_slippage_on_intraday_last_fills() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -1861,6 +1877,7 @@ fn broker_rejects_intraday_last_order_without_execution_quotes() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -1969,6 +1986,7 @@ fn broker_executes_intraday_last_on_start_quote_without_trade_delta() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2086,6 +2104,7 @@ fn broker_cancels_market_order_remainder_when_intraday_quote_liquidity_exhausted
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2215,6 +2234,7 @@ fn broker_cancels_market_buy_when_minute_has_no_volume() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2320,6 +2340,7 @@ fn broker_splits_intraday_quote_fills_and_tracks_commission_by_order() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2482,6 +2503,7 @@ fn broker_aggregates_intraday_quote_fills_into_vwap_leg() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2628,6 +2650,7 @@ fn broker_executes_algo_vwap_value_with_time_window() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2787,6 +2810,7 @@ fn broker_executes_algo_twap_percent_across_window_quotes() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -2948,6 +2972,7 @@ fn broker_uses_best_own_price_for_intraday_matching() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3064,6 +3089,7 @@ fn broker_uses_best_counterparty_price_for_intraday_matching() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3230,6 +3256,7 @@ fn rebalance_optimizer_skips_unfunded_buy_when_existing_position_cannot_sell() {
date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3242,6 +3269,7 @@ fn rebalance_optimizer_skips_unfunded_buy_when_existing_position_cannot_sell() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3420,6 +3448,7 @@ fn rebalance_uses_prev_close_for_open_auction_valuation() {
date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3432,6 +3461,7 @@ fn rebalance_uses_prev_close_for_open_auction_valuation() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3604,6 +3634,7 @@ fn rebalance_optimizer_prioritizes_higher_target_weight_when_cash_is_tight() {
date,
symbol: "000001.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3616,6 +3647,7 @@ fn rebalance_optimizer_prioritizes_higher_target_weight_when_cash_is_tight() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3743,6 +3775,7 @@ fn broker_uses_board_specific_min_quantity_and_step_size_for_buy_sizing() {
date,
symbol: "688001.SH".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3846,6 +3879,7 @@ fn broker_allows_bjse_quantities_above_minimum_without_round_lot_step() {
date,
symbol: "430001.BJ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -3951,6 +3985,7 @@ fn broker_allows_full_odd_lot_sell_when_liquidating_position() {
date,
symbol: symbol.to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -4067,6 +4102,7 @@ fn same_day_sell_then_rebuy_is_rejected_by_default() {
date,
symbol: (*symbol).to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -4206,6 +4242,7 @@ fn same_day_sell_then_rebuy_can_be_allowed_by_policy() {
date,
symbol: (*symbol).to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -4466,6 +4503,7 @@ fn two_day_limit_order_data(day1_open: f64, day2_open: f64) -> DataSet {
date: day1,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -4478,6 +4516,7 @@ fn two_day_limit_order_data(day1_open: f64, day2_open: f64) -> DataSet {
date: day2,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,
@@ -4885,6 +4924,7 @@ fn broker_reserves_sellable_quantity_for_open_limit_sells() {
date,
symbol: "000002.SZ".to_string(),
is_st: false,
is_star_st: false,
is_new_listing: false,
is_paused: false,
allow_buy: true,