diff --git a/crates/fidc-core/src/platform_expr_strategy.rs b/crates/fidc-core/src/platform_expr_strategy.rs index 776720e..67c08ce 100644 --- a/crates/fidc-core/src/platform_expr_strategy.rs +++ b/crates/fidc-core/src/platform_expr_strategy.rs @@ -2283,9 +2283,21 @@ impl PlatformExprStrategy { loop { let mut budget_working_symbols = slot_working_symbols.clone(); budget_working_symbols.extend(same_bar_buy_symbols.iter().cloned()); - if Self::effective_slot_count(&budget_working_symbols, slot_blocking_symbols) - >= selection_limit - { + let effective_slot_count = + Self::effective_slot_count(&budget_working_symbols, slot_blocking_symbols); + if effective_slot_count >= selection_limit { + if debug_daily_top_up { + daily_top_up_debug_notes.push(format!( + "daily_top_up_stop date={} reason=slot_full effective_slots={} selection_limit={} slot_working={} same_bar_buys={} slot_blocking={} current_position={}", + execution_date, + effective_slot_count, + selection_limit, + slot_working_symbols.len(), + same_bar_buy_symbols.len(), + slot_blocking_symbols.len(), + current_position_symbol.unwrap_or("-") + )); + } break; } let value_symbols = budget_working_symbols.clone(); @@ -2328,6 +2340,15 @@ impl PlatformExprStrategy { )); } if slot_buy_cash <= 0.0 || available_buy_cash < slot_buy_cash * 0.5 { + if debug_daily_top_up { + daily_top_up_debug_notes.push(format!( + "daily_top_up_stop date={} reason=insufficient_cash slot_buy_cash={:.4} available_cash={:.4} current_position={}", + execution_date, + slot_buy_cash, + available_buy_cash, + current_position_symbol.unwrap_or("-") + )); + } break; } @@ -2415,6 +2436,19 @@ impl PlatformExprStrategy { } } if !attempted_any || !filled_any { + if debug_daily_top_up { + daily_top_up_debug_notes.push(format!( + "daily_top_up_stop date={} reason=no_candidate attempted_any={} filled_any={} current_position={} attempted_buys={} exit_symbols={} pending_full_close={} delayed_sold={}", + execution_date, + attempted_any, + filled_any, + current_position_symbol.unwrap_or("-"), + intraday_attempted_buys.len(), + exit_symbols.len(), + pending_full_close_symbols.len(), + delayed_sold_symbols.len() + )); + } break; } }