修正AiQuant兼容佣金默认值

This commit is contained in:
boris
2026-06-23 12:30:09 +08:00
parent ad405d130e
commit 1bcedcee0f
2 changed files with 17 additions and 0 deletions
+16
View File
@@ -66,6 +66,22 @@ fn china_cost_model_applies_minimum_commission_and_stamp_tax() {
assert!((sell.stamp_tax - 100.0).abs() < 1e-9);
}
#[test]
fn aiquant_rqalpha_cost_model_matches_alv_run_options() {
let model = ChinaAShareCostModel::aiquant_rqalpha_default();
let buy = model.calculate(d(2026, 5, 19), OrderSide::Buy, 49_978.84);
assert!((buy.commission - 12.49471).abs() < 1e-9);
assert_eq!(buy.stamp_tax, 0.0);
let sell = model.calculate(d(2026, 5, 19), OrderSide::Sell, 100_724.72);
assert!((sell.commission - 25.18118).abs() < 1e-9);
assert!((sell.stamp_tax - 50.36236).abs() < 1e-9);
let small_buy = model.calculate(d(2026, 5, 19), OrderSide::Buy, 1_000.0);
assert!((small_buy.commission - 5.0).abs() < 1e-9);
}
#[test]
fn china_cost_model_switches_stamp_tax_rate_after_2023_08_28() {
let model = ChinaAShareCostModel::default();