修正AiQuant兼容选股剔除北交所
This commit is contained in:
@@ -1756,6 +1756,9 @@ pub fn platform_expr_config_from_spec(
|
||||
if aiquant_profile {
|
||||
cfg.aiquant_transaction_cost = true;
|
||||
cfg.strict_value_budget = true;
|
||||
if !cfg.universe_exclude.iter().any(|item| item == "bjse") {
|
||||
cfg.universe_exclude.push("bjse".to_string());
|
||||
}
|
||||
let trading = spec
|
||||
.runtime_expressions
|
||||
.as_ref()
|
||||
@@ -2308,7 +2311,10 @@ mod tests {
|
||||
assert_eq!(cfg.signal_symbol, "000852.SH");
|
||||
assert_eq!(cfg.selection_limit_expr, "stocknum");
|
||||
assert_eq!(cfg.refresh_rate_expr, "year >= 2024 ? 5 : 20");
|
||||
assert_eq!(cfg.universe_exclude, ["paused", "st", "kcb", "one_yuan"]);
|
||||
assert_eq!(
|
||||
cfg.universe_exclude,
|
||||
["paused", "st", "kcb", "one_yuan", "bjse"]
|
||||
);
|
||||
assert!(!cfg.rotation_enabled);
|
||||
assert!(cfg.daily_top_up_enabled);
|
||||
assert!(cfg.retry_empty_rebalance);
|
||||
|
||||
Reference in New Issue
Block a user