From 08560d05f2e09417212826b1b58a96b367134f33 Mon Sep 17 00:00:00 2001 From: gavindiaz Date: Wed, 22 Jul 2026 02:10:02 +0800 Subject: [PATCH] Fix critical bug: watcher was ignoring every real ENTER signal The bot writes recommendation as "side:phase:strength" (e.g. "UP:MID:STRONG") without an "ENTER:" prefix per src/index.js:721. The watcher checked startsWith("ENTER"), so all real signals were treated as NO_TRADE. Only manual test rows (which I had user write with ENTER: prefix for clarity) ever triggered. 7,460 real signals over 8 hours were silently ignored. Detection now uses rec.includes(":") as the ENTER marker, parses side from split[0] and phase/strength from [1]/[2]. --- scripts/telegram-watcher.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/telegram-watcher.js b/scripts/telegram-watcher.js index d02dc83..e96b796 100644 --- a/scripts/telegram-watcher.js +++ b/scripts/telegram-watcher.js @@ -110,12 +110,13 @@ function watch() { try { const data = readLast(); if (!data) return; - const side = data.rec.startsWith("ENTER") ? data.rec.split(":")[1] : null; + const isEnter = data.rec.includes(":"); + const side = isEnter ? data.rec.split(":")[0] : null; if (!side) { prevSide = null; return; } - const [, , phase, strength] = data.rec.split(":"); + const [, phase, strength] = data.rec.split(":"); const ts = data.row[data.hdr.indexOf("timestamp")]; const flipped = side !== prevSide; const cooled = Date.now() - lastSentAt > COOLDOWN_MS;