From fb9d8f3b9ab03fe7b28373b7a523b687fad7c5dc Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 1 Jul 2026 15:07:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3AiQuant=E5=9B=9E=E6=B5=8B?= =?UTF-8?q?=E4=BD=A3=E9=87=91=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/fidc-core/src/cost.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/crates/fidc-core/src/cost.rs b/crates/fidc-core/src/cost.rs index 6b31f8f..fa9ac2b 100644 --- a/crates/fidc-core/src/cost.rs +++ b/crates/fidc-core/src/cost.rs @@ -55,7 +55,7 @@ impl Default for ChinaAShareCostModel { impl ChinaAShareCostModel { pub fn aiquant_default() -> Self { Self { - commission_rate: 0.00025, + commission_rate: 0.0008, stamp_tax_rate_before_change: 0.0005, stamp_tax_rate_after_change: 0.0005, ..Self::default() @@ -170,3 +170,19 @@ impl CostModel for ChinaAShareCostModel { } } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn aiquant_default_matches_current_backtest_fee_model() { + let model = ChinaAShareCostModel::aiquant_default(); + let date = NaiveDate::from_ymd_opt(2025, 11, 11).expect("valid date"); + + assert!((model.commission_for(248_059.812) - 198.4478496).abs() < 1e-9); + assert!( + (model.stamp_tax_for(date, OrderSide::Sell, 245_747.007) - 122.8735035).abs() < 1e-9 + ); + } +}