deploy: OOS holdout + telegram 0/0 fix — trading/telegram_notify.py
Browse files
trading/telegram_notify.py
CHANGED
|
@@ -420,9 +420,14 @@ def _fmt_scan_started(d: dict) -> str:
|
|
| 420 |
def _fmt_scan_progress(d: dict) -> str:
|
| 421 |
flag = _market_flag(d)
|
| 422 |
stage = d.get("stage", "?")
|
| 423 |
-
idx = d.get("index", 0)
|
| 424 |
-
total = d.get("total", 0)
|
| 425 |
eligible = d.get("eligible_count", 0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 426 |
pct = (idx / total * 100) if total else 0
|
| 427 |
return (
|
| 428 |
f"{flag}🔍 <b>Tarama İlerleme</b>\n\n"
|
|
|
|
| 420 |
def _fmt_scan_progress(d: dict) -> str:
|
| 421 |
flag = _market_flag(d)
|
| 422 |
stage = d.get("stage", "?")
|
|
|
|
|
|
|
| 423 |
eligible = d.get("eligible_count", 0)
|
| 424 |
+
# chunk_done notifications send stage2_done/stage2_total; live progress sends index/total
|
| 425 |
+
if stage == "chunk_done":
|
| 426 |
+
idx = d.get("stage2_done", 0)
|
| 427 |
+
total = d.get("stage2_total", 0)
|
| 428 |
+
else:
|
| 429 |
+
idx = d.get("index", 0)
|
| 430 |
+
total = d.get("total", 0)
|
| 431 |
pct = (idx / total * 100) if total else 0
|
| 432 |
return (
|
| 433 |
f"{flag}🔍 <b>Tarama İlerleme</b>\n\n"
|