Refine open auction execution semantics

This commit is contained in:
boris
2026-04-23 00:05:41 -07:00
parent fa4126a662
commit df1054ab8a
3 changed files with 35 additions and 4 deletions

View File

@@ -179,7 +179,8 @@ fn broker_uses_day_open_price_for_open_auction_matching() {
ChinaAShareCostModel::default(),
ChinaEquityRuleHooks::default(),
PriceField::DayOpen,
);
)
.with_slippage_model(SlippageModel::PriceRatio(0.05));
let report = broker
.execute(
@@ -203,6 +204,10 @@ fn broker_uses_day_open_price_for_open_auction_matching() {
assert_eq!(report.fill_events.len(), 1);
assert!((report.fill_events[0].price - 9.8).abs() < 1e-9);
let position = portfolio.position("000002.SZ").expect("position");
let expected_total_equity = portfolio.cash() + position.quantity as f64 * 9.8;
assert_eq!(report.account_events.len(), 1);
assert!((report.account_events[0].total_equity - expected_total_equity).abs() < 1e-6);
}
#[test]