兼容AiQuant回测profile别名
This commit is contained in:
@@ -395,7 +395,7 @@ fn valid_non_negative(value: Option<f64>) -> Option<f64> {
|
|||||||
fn is_aiquant_profile(value: Option<&str>) -> bool {
|
fn is_aiquant_profile(value: Option<&str>) -> bool {
|
||||||
value
|
value
|
||||||
.map(|item| item.trim().to_ascii_lowercase().replace('-', "_"))
|
.map(|item| item.trim().to_ascii_lowercase().replace('-', "_"))
|
||||||
.is_some_and(|item| item == "aiquant")
|
.is_some_and(|item| item == "aiquant" || item == "aiquant_rqalpha" || item == "rqalpha")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn apply_cost_overrides(
|
fn apply_cost_overrides(
|
||||||
@@ -1865,6 +1865,22 @@ mod tests {
|
|||||||
assert!(cfg.aiquant_transaction_cost);
|
assert!(cfg.aiquant_transaction_cost);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn engine_config_profile_name_accepts_aiquant_rqalpha_alias() {
|
||||||
|
let spec = serde_json::json!({
|
||||||
|
"engineConfig": {
|
||||||
|
"profileName": "aiquant_rqalpha"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let cfg = platform_expr_config_from_value("", "", &spec).expect("config");
|
||||||
|
|
||||||
|
assert!(cfg.aiquant_transaction_cost);
|
||||||
|
assert!(cfg.daily_top_up_enabled);
|
||||||
|
assert!(cfg.retry_empty_rebalance);
|
||||||
|
assert!(cfg.strict_value_budget);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn runtime_expressions_infer_ma_windows_from_literal_strategy_logic() {
|
fn runtime_expressions_infer_ma_windows_from_literal_strategy_logic() {
|
||||||
let spec = serde_json::json!({
|
let spec = serde_json::json!({
|
||||||
|
|||||||
Reference in New Issue
Block a user