修正AiQuant等权调仓预算
This commit is contained in:
@@ -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"))
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user