19 Commits

Author SHA1 Message Date
gavindiaz c264ba4d47 Wire watcher into CONFIG + load env in npm scripts
- npm start / watch:telegram: add --env-file=env so TELEGRAM_* and HTTPS_PROXY from nv reach process.env
- watcher: import CONFIG.candleWindowMinutes from src/config.js so the per-window latch stays in sync with the bot
- watcher: replace prevSide/cooldown latch with lastSentWindowId keyed on floor(ts/WINDOW_MS); one alert per window, NO_TRADE rows no longer reset state
2026-07-22 07:29:42 +08:00
gavindiaz 9c713ad3f6 Add analyze.sh: diagnostic script for signals.csv
Outputs: file info, time span, recommendation breakdown, max edges,
phase distribution, max model probabilities per phase, would-be ENTER
breakdown by regime, recent rows, and PM2 error tails.

Use when no pushes arrive to distinguish 'no signals' from 'signals
being swallowed' — see DEPLOYMENT.md pitfall #7.
2026-07-22 02:21:11 +08:00
gavindiaz 3c3899a115 Add pitfall #7 (recommendation format bug) + diagnostic script reference
After 8 hours of silent signal swallowing, document:
- Root cause: watcher expected "ENTER:" prefix but bot writes "side:phase:strength"
- Discovery method: analyze.sh recommendation distribution shows signals vs pushes
- Fix commit reference: 08560d0
- Three concrete lessons for cross-process data contracts

Also:
- Reference analyze.sh in cheat sheet (信号诊断 command)
- Fix manual test format in cheat sheet (no more ENTER: prefix)
- Add file structure entry for analyze.sh
- Add security checklist item: check real field formats before editing parsers
2026-07-22 02:21:02 +08:00
gavindiaz 08560d05f2 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].
2026-07-22 02:10:02 +08:00
gavindiaz 5cafbfa775 Add DEPLOYMENT.md: full cloud deployment guide
11 sections covering architecture, prerequisites, one-time deploy,
day-to-day ops, code updates, 6 real-world pitfalls with root cause +
fix commits, file layout, checklists, and cheat sheet.
2026-07-21 18:42:52 +08:00
gavindiaz 4505c1155b Fix market JSON dump: was guarded by priceToBeatState.value === null but latching at line 589-595 sets value before line 622 check runs. JSON files never written. Remove the broken guard; dumpedMarkets.has(slug) already ensures once-per-market. 2026-07-21 18:30:18 +08:00
gavindiaz ee2ab5dda4 Fix double-push race + add slug debug log
Two fs.watch callbacks can fire for the same row within the 300ms debounce
window. Both enter the setTimeout, both read prevSide=null before either
sets it, both call send(). Result: duplicate push within ~20ms.

Fix: track lastSentTs. Same row timestamp = skip. Only a NEW row from
the bot (or a new manual append) can trigger another push.

Also log the slug before each push so we can diagnose the missing link.
2026-07-21 18:25:02 +08:00
gavindiaz 9b0da0279f Add Telegram watcher, dashboard docs, and deployment config
- scripts/telegram-watcher.js: push ENTER signals from signals.csv to Telegram
- DASHBOARD_GUIDE.md: complete dashboard field-by-field documentation
- package.json: add watch:telegram npm script
- .env.example: deployment env template
- .gitignore: exclude ecosystem.config.cjs/start.sh (server-only with paths)

Watcher reads recommendation column and triggers on:
  - transition NO_TRADE -> ENTER:side
  - flip ENTER:UP <-> ENTER:DOWN
  - 30s cooldown prevents spam
2026-07-21 18:00:21 +08:00
FrondEnt 5955967a59 README: proxy auth guide 2026-01-30 00:25:30 +02:00
FrondEnt f67970c34e Add proxy support (HTTP + WebSocket) 2026-01-30 00:22:45 +02:00
FrondEnt 331ffcfcdf README: add ZIP download instructions 2026-01-29 22:23:47 +02:00
Krajekis bd0b1e0bfd Update README.md 2026-01-29 22:21:34 +02:00
Krajekis 3fb3cb9345 Update README.md 2026-01-29 22:21:18 +02:00
Krajekis 1e48759ffe Update README.md 2026-01-29 22:20:43 +02:00
Krajekis 02dcc7c876 Update README.md 2026-01-29 22:20:33 +02:00
Krajekis 97dec3d563 Update README.md 2026-01-29 22:20:19 +02:00
FrondEnt d6f09e7cd9 README: add official Node.js download link 2026-01-29 22:18:27 +02:00
FrondEnt b82c5d8199 Update README: terminal run steps 2026-01-29 22:16:38 +02:00
FrondEnt 1b9535a9cb Initial commit 2026-01-29 22:13:37 +02:00