From c5f786c116b104f9cc86fc24a44dca7cd13561a8 Mon Sep 17 00:00:00 2001 From: anor Date: Tue, 10 Mar 2026 13:57:35 +1000 Subject: [PATCH] =?UTF-8?q?feat:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20milestones=20=D0=B2=D0=B0=D0=BB=D0=B8=D0=B4?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B8=20=D0=B2=20=D1=83=D1=82=D1=80=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D0=B8=D0=B9=20=D0=BE=D1=82=D1=87=D1=91=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - День live-торговли с 08.03.2026 - Всего сделок / WR (cumulative) - Обратный отсчёт: 50 trades (статзначимость), 90д (Sharpe), 180д (полный цикл) - Счётчик до 100 trades Co-Authored-By: Claude Opus 4.6 --- src/remizov_trader/notify.py | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/remizov_trader/notify.py b/src/remizov_trader/notify.py index 576128b..537ceb0 100644 --- a/src/remizov_trader/notify.py +++ b/src/remizov_trader/notify.py @@ -329,6 +329,47 @@ def format_morning_report(cfg, conn) -> str: lines.append(f"\u2699\ufe0f Циклов: {cycle_rows['cnt']} | " f"Avg: {cycle_rows['avg_dur']:.1f}s") + # --- Validation milestones --- + from datetime import date + LIVE_START = date(2026, 3, 8) + today = now.date() + live_days = (today - LIVE_START).days + + # Total real trades (excluding failures/resets) + total_real = conn.execute( + "SELECT COUNT(*) as cnt, SUM(CASE WHEN pnl_net > 0 THEN 1 ELSE 0 END) as wins " + "FROM positions WHERE status='closed' " + "AND exit_reason NOT IN ('live_buy_failed', 'manual_reset', 'phantom_cleanup', 'portfolio_rebalance')" + ).fetchone() + total_trades = total_real["cnt"] if total_real else 0 + total_wins = total_real["wins"] if total_real else 0 + live_wr = total_wins / total_trades * 100 if total_trades > 0 else 0 + + lines.append("") + lines.append(f"\U0001f3af Валидация (день {live_days})") + lines.append(f"{S*3}Всего сделок: {total_trades} | WR: {live_wr:.0f}%") + + # Milestones + milestones = [ + (50, "статзначимость (50 trades)"), + (90, "Sharpe из live (3 мес)"), + (180, "полный цикл рынка (6 мес)"), + ] + for target_days, label in milestones: + remaining = target_days - live_days + if remaining > 0: + target_date = LIVE_START + timedelta(days=target_days) + lines.append(f"{S*3}\u23f3 {label}: {remaining}д ({target_date.strftime('%d.%m')})") + else: + lines.append(f"{S*3}\u2705 {label}: ГОТОВО") + + # Trade milestone + trades_remaining = max(0, 100 - total_trades) + if trades_remaining > 0: + lines.append(f"{S*3}\u23f3 100 trades: ещё {trades_remaining}") + else: + lines.append(f"{S*3}\u2705 100 trades: ГОТОВО") + return "\n".join(lines)