fix: add first-skip-reason logging to backtest replay for debugging

This commit is contained in:
Celes Renata
2026-04-16 00:16:32 +00:00
parent 357e68a764
commit bad7e02e53
+11
View File
@@ -190,6 +190,17 @@ class BacktestReplay:
} }
portfolio_state.active_pool -= cost portfolio_state.active_pool -= cost
portfolio_state.open_position_count += 1 portfolio_state.open_position_count += 1
elif act_count == 0 and not hasattr(self, '_first_skip_logged'):
# Log the first skip reason for debugging
logger.warning(
"Backtest first skip: ticker=%s reason=%s conf=%.2f price=%.2f pool=%.2f",
decision.ticker,
decision.skip_reason,
rec.get("confidence", 0.0),
rec.get("current_price", 0.0),
portfolio_state.active_pool,
)
self._first_skip_logged = True
if day_recs: if day_recs:
logger.info( logger.info(