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:
@@ -110,12 +110,13 @@ function watch() {
|
|||||||
try {
|
try {
|
||||||
const data = readLast();
|
const data = readLast();
|
||||||
if (!data) return;
|
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) {
|
if (!side) {
|
||||||
prevSide = null;
|
prevSide = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const [, , phase, strength] = data.rec.split(":");
|
const [, phase, strength] = data.rec.split(":");
|
||||||
const ts = data.row[data.hdr.indexOf("timestamp")];
|
const ts = data.row[data.hdr.indexOf("timestamp")];
|
||||||
const flipped = side !== prevSide;
|
const flipped = side !== prevSide;
|
||||||
const cooled = Date.now() - lastSentAt > COOLDOWN_MS;
|
const cooled = Date.now() - lastSentAt > COOLDOWN_MS;
|
||||||
|
|||||||
Reference in New Issue
Block a user