修正AiQuant等权调仓预算

This commit is contained in:
boris
2026-07-01 15:00:55 +08:00
parent eae82128ee
commit cad8877b7a
3 changed files with 26 additions and 26 deletions
+20 -10
View File
@@ -410,8 +410,14 @@ fn engine_settles_same_day_dividend_after_split_for_aiquant_semantics() {
delisted_at: None,
status: "active".to_string(),
}],
vec![stock_market_snapshot(buy_date), stock_market_snapshot(ex_date)],
vec![stock_factor_snapshot(buy_date), stock_factor_snapshot(ex_date)],
vec![
stock_market_snapshot(buy_date),
stock_market_snapshot(ex_date),
],
vec![
stock_factor_snapshot(buy_date),
stock_factor_snapshot(ex_date),
],
vec![stock_candidate(buy_date), stock_candidate(ex_date)],
vec![benchmark_snapshot(buy_date), benchmark_snapshot(ex_date)],
vec![CorporateAction {
@@ -469,12 +475,16 @@ fn engine_settles_same_day_dividend_after_split_for_aiquant_semantics() {
assert_eq!(reinvest_fill.quantity, 100);
assert!((reinvest_fill.price - ((10.0 - 1.05) / 1.2)).abs() < 1e-9);
assert!(result
.position_events
.iter()
.any(|event| event.reason == "stock_split 1.200000" && event.quantity_after == 1_200));
assert!(result
.account_events
.iter()
.any(|event| event.note.contains("cash_receivable_reinvested")));
assert!(
result
.position_events
.iter()
.any(|event| event.reason == "stock_split 1.200000" && event.quantity_after == 1_200)
);
assert!(
result
.account_events
.iter()
.any(|event| event.note.contains("cash_receivable_reinvested"))
);
}