修正AiQuant兼容佣金默认值
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user