跳过零管理费无效集合复制

This commit is contained in:
boris
2026-08-26 06:38:19 +08:00
parent 782bc640ff
commit 8b246a63f0
+21 -14
View File
@@ -2952,20 +2952,27 @@ where
merge_broker_report(&mut directive_report, futures_daily_settlement_report); merge_broker_report(&mut directive_report, futures_daily_settlement_report);
let futures_expiration_report = self.settle_futures_expirations(execution_date); let futures_expiration_report = self.settle_futures_expirations(execution_date);
merge_broker_report(&mut directive_report, futures_expiration_report); merge_broker_report(&mut directive_report, futures_expiration_report);
let dynamic_universe_snapshot = self.dynamic_universe.clone(); let management_fee_report = if portfolio.management_fee_rate() <= 0.0 {
let subscriptions_snapshot = self.subscriptions.clone(); BrokerExecutionReport::default()
let management_fee_report = self.apply_management_fee( } else {
execution_date, // The strategy context needs an immutable view while the
decision_date, // engine mutably invokes the strategy. Avoid cloning these
decision_index, // potentially large sets unless management fees are enabled.
&mut portfolio, let dynamic_universe_snapshot = self.dynamic_universe.clone();
&post_close_open_orders, let subscriptions_snapshot = self.subscriptions.clone();
dynamic_universe_snapshot.as_ref(), self.apply_management_fee(
&subscriptions_snapshot, execution_date,
&mut process_events, decision_date,
result.order_events.as_slice(), decision_index,
result.fills.as_slice(), &mut portfolio,
)?; &post_close_open_orders,
dynamic_universe_snapshot.as_ref(),
&subscriptions_snapshot,
&mut process_events,
result.order_events.as_slice(),
result.fills.as_slice(),
)?
};
merge_broker_report(&mut directive_report, management_fee_report); merge_broker_report(&mut directive_report, management_fee_report);
publish_phase_event( publish_phase_event(
&mut self.strategy, &mut self.strategy,