修正滑点成交后的持仓估值

This commit is contained in:
boris
2026-06-14 02:09:44 +08:00
parent 0cfb7625bf
commit 80b34280c2
3 changed files with 88 additions and 21 deletions
@@ -1701,6 +1701,9 @@ fn broker_applies_tick_size_slippage_on_intraday_last_fills() {
assert_eq!(report.fill_events.len(), 1);
assert!((report.fill_events[0].price - 10.02).abs() < 1e-9);
let position = portfolio.position("000002.SZ").expect("position");
assert!((position.last_price - 10.0).abs() < 1e-9);
assert!((position.market_value() - position.quantity as f64 * 10.0).abs() < 1e-6);
}
#[test]