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].
This commit is contained in:
2026-07-22 02:10:02 +08:00
parent 5cafbfa775
commit 08560d05f2
+3 -2
View File
@@ -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;