修正滑点成交后的持仓估值
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user