@@ -244,31 +244,32 @@ def main():
244244 traceback .print_exc ()
245245 return 1
246246
247- # Gather statistics
247+ # Gather statistics from ProviderRouter (real values, no placeholders)
248248 stats = router .stats
249- stats ['total_losers' ] = stats .get ('fmp_requests' , 0 ) > 0 # Approximate
250- stats ['after_percent_filter' ] = len (stocks ) if stocks else 0
251-
252- # We need to capture these during the run - for now, estimate
253- # In production, you'd track these in the ProviderRouter
254- stats ['total_losers' ] = 50 # Placeholder - actual count from API
255- stats ['after_percent_filter' ] = 10 # Placeholder
249+ stats ['total_scanned' ] = int (stats .get ('total_scanned' , 0 ) or 0 )
250+ stats ['total_losers' ] = int (stats .get ('total_losers' , 0 ) or 0 )
251+ # Step 1 already returns symbols at/under the % threshold, so this equals losers count.
252+ stats ['after_percent_filter' ] = stats ['total_losers' ]
253+ stats ['after_sector_mcap_filter' ] = len (stocks )
256254
257255 # Print results
258256 print_results (stocks )
259257
260258 # Print stats
261259 print ("\n Run Statistics:" )
260+ print (f" Total scanned: { stats .get ('total_scanned' , 0 )} " )
261+ print (f" Candidates from losers feed: { stats .get ('total_losers' , 0 )} " )
262+ print (f" After sector + mcap filter: { stats .get ('after_sector_mcap_filter' , len (stocks ))} " )
262263 print (f" FMP API requests: { stats .get ('fmp_requests' , 'N/A' )} " )
263264 if 'twelve_data_credits' in stats :
264265 td_credits = stats ['twelve_data_credits' ]
265266 print (f" Twelve Data credits used today: { td_credits .get ('daily_used' , 0 )} " )
266267 print (f" Twelve Data credits remaining: { td_credits .get ('daily_remaining' , 0 )} " )
267268 print (f" Verification used: { stats .get ('verification_used' , False )} " )
268269
269- # Send email (unless dry run)
270+ # Send email (unless dry run). Send even with zero final matches so daily summary is visible.
270271 email_sent = False
271- if not args .dry_run and stocks :
272+ if not args .dry_run :
272273 print ("\n [Email] Preparing to send report..." )
273274
274275 gmail = GmailSender ()
@@ -287,8 +288,6 @@ def main():
287288 return 1
288289 elif args .dry_run :
289290 print ("\n [Dry Run] Email not sent (--dry-run mode)" )
290- elif not stocks :
291- print ("\n [Email] No stocks to report, email not sent" )
292291
293292 mark_day_completed (run_timestamp , len (stocks ), email_sent )
294293
0 commit comments