共享固定数值因子字段名

This commit is contained in:
boris
2026-08-25 20:25:05 +08:00
parent fac5078dbf
commit 01cffb947c
4 changed files with 73 additions and 73 deletions
+20 -20
View File
@@ -10,11 +10,11 @@ use fidc_core::{
ChinaEquityRuleHooks, DailyFactorSnapshot, DailyMarketSnapshot, DataSet, ExecutionQuoteRequest,
FuturesAccountState, FuturesCommissionType, FuturesContractSpec, FuturesDirection,
FuturesOrderIntent, FuturesPositionEffect, FuturesTradingParameter, FuturesValidationConfig,
Instrument, IntradayExecutionQuote, IntradayOrderBookDepthLevel, MatchingType, OpenOrderView,
OrderIntent, OrderSide, OrderStatus, PlatformExprStrategy, PlatformExprStrategyConfig,
PlatformTradeAction, PortfolioState, PriceField, ProcessEvent, ProcessEventBus,
ProcessEventKind, ScheduleRule, ScheduleStage, ScheduleTimeRule, Strategy, StrategyContext,
StrategyDecision,
Instrument, IntradayExecutionQuote, IntradayOrderBookDepthLevel, MatchingType,
NumericFactorMap, OpenOrderView, OrderIntent, OrderSide, OrderStatus, PlatformExprStrategy,
PlatformExprStrategyConfig, PlatformTradeAction, PortfolioState, PriceField, ProcessEvent,
ProcessEventBus, ProcessEventKind, ScheduleRule, ScheduleStage, ScheduleTimeRule, Strategy,
StrategyContext, StrategyDecision,
};
fn d(year: i32, month: u32, day: u32) -> NaiveDate {
@@ -133,7 +133,7 @@ fn market_row(date: NaiveDate, symbol: &str, open: f64, close: f64) -> DailyMark
fn factor_row(
date: NaiveDate,
symbol: &str,
extra_factors: BTreeMap<String, f64>,
extra_factors: NumericFactorMap,
) -> DailyFactorSnapshot {
DailyFactorSnapshot {
date,
@@ -209,26 +209,26 @@ fn two_day_futures_data() -> DataSet {
d1,
"000001.SZ",
BTreeMap::from([
("custom_alpha".to_string(), 7.0),
("margin_all".to_string(), 1.0),
("yield_curve_1y".to_string(), 0.02),
("total_shares".to_string(), 123.0),
("stock_connect_north_bound".to_string(), 1.0),
("industry_citics_l1".to_string(), 10.0),
("fundamental_net_profit".to_string(), 99.0),
("custom_alpha".into(), 7.0),
("margin_all".into(), 1.0),
("yield_curve_1y".into(), 0.02),
("total_shares".into(), 123.0),
("stock_connect_north_bound".into(), 1.0),
("industry_citics_l1".into(), 10.0),
("fundamental_net_profit".into(), 99.0),
]),
),
factor_row(
d2,
"000001.SZ",
BTreeMap::from([
("custom_alpha".to_string(), 8.0),
("margin_all".to_string(), 1.0),
("yield_curve_1y".to_string(), 0.021),
("total_shares".to_string(), 124.0),
("stock_connect_north_bound".to_string(), 1.0),
("industry_citics_l1".to_string(), 10.0),
("fundamental_net_profit".to_string(), 101.0),
("custom_alpha".into(), 8.0),
("margin_all".into(), 1.0),
("yield_curve_1y".into(), 0.021),
("total_shares".into(), 124.0),
("stock_connect_north_bound".into(), 1.0),
("industry_citics_l1".into(), 10.0),
("fundamental_net_profit".into(), 101.0),
]),
),
],