From d71254a57e3a7ad76220508617e7a35bc23105b4 Mon Sep 17 00:00:00 2001 From: mindesbunister Date: Sat, 22 Nov 2025 16:15:18 +0100 Subject: [PATCH] docs: Document quality-blocked signal tracking discovery Updates to copilot-instructions.md: - Multi-Timeframe Price Tracking System section enhanced - BlockedSignalTracker purpose clarified: validates quality 91 threshold - Current Status updated with Nov 22 enhancement details - First false negative result documented (quality 80, +0.52% missed profit) Signal Quality Scoring section: - Added 'Threshold Validation In Progress' subsection - User observation documented: 'green dots shot up' - Data collection criteria defined (20-30 blocked signals) - Decision framework added: Keep 91 vs lower to 85 vs adjust weights - Possible outcomes listed for data-driven optimization Next Steps: - Continue collecting quality-blocked signal data (2-4 weeks) - Target: 20-30 signals with complete price tracking - SQL analysis: Compare blocked signal win rate vs executed trades - Decision: Validate quality 91 threshold or adjust based on data Purpose: Complete documentation of missed opportunity discovery and validation plan for quality threshold optimization. --- .github/copilot-instructions.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index b2780bc..58a0ca7 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -475,11 +475,13 @@ docker system df 1. **BlockedSignalTracker** (`lib/analysis/blocked-signal-tracker.ts`) - Background job running every 5 minutes + - **Tracks BOTH quality-blocked AND data collection signals** (Nov 22, 2025 enhancement) - Tracks price at 1min, 5min, 15min, 30min intervals - Detects if TP1/TP2/SL would have been hit using ATR-based targets - Records max favorable/adverse excursion (MFE/MAE) - Auto-completes after 30 minutes (`analysisComplete=true`) - Singleton pattern: Use `getBlockedSignalTracker()` or `startBlockedSignalTracking()` + - **Purpose:** Validate if quality 91 threshold filters winners or losers (data-driven optimization) 2. **Database Schema** (BlockedSignal table) ```sql @@ -562,14 +564,16 @@ WHERE "blockReason" = 'QUALITY_SCORE_TOO_LOW' - **Comprehensive:** Tracks best/worst case scenarios (MFE/MAE) - **API accessible:** Check status anytime via `/api/analytics/signal-tracking` -**Current Status (Nov 19, 2025):** +**Current Status (Nov 22, 2025):** - ✅ System deployed and running in production -- ✅ 2 signals tracked (15min and 1H collecting price data) +- ✅ **Enhanced Nov 22:** Now tracks quality-blocked signals (QUALITY_SCORE_TOO_LOW) in addition to multi-timeframe data collection - ✅ TradingView alerts configured for 15min and 1H - ✅ Background tracker runs every 5 minutes autonomously -- 📋 Next: Set up 4H and Daily alerts -- 📊 Target: Collect 50+ signals per timeframe for cross-timeframe comparison -- 🎯 Goal: Determine which timeframe has best win rate, switch production accordingly +- 📊 **Data collection:** Multi-timeframe (50+ per timeframe) + quality-blocked (20-30 signals) +- 🎯 **Dual goals:** + 1. Determine which timeframe has best win rate + 2. Validate if quality 91 threshold filters winners or losers +- 📈 **First result (Nov 21, 16:50):** Quality 80 signal blocked (weak ADX 16.6), would have profited +0.52% (+$43) within 1 minute - **FALSE NEGATIVE confirmed** --- @@ -701,6 +705,17 @@ scoreSignalQuality({ - Would have prevented all historical losses totaling -$624.90 - Pattern validates that quality ≥95 signals are high-probability setups +**Threshold Validation In Progress (Nov 22, 2025):** +- **Discovery:** First quality-blocked signal (quality 80, ADX 16.6) would have profited +0.52% (+$43) +- **User observation:** "Green dots shot up" - visual confirmation of missed opportunity +- **System response:** BlockedSignalTracker now tracks quality-blocked signals (QUALITY_SCORE_TOO_LOW) +- **Data collection target:** 20-30 blocked signals over 2-4 weeks +- **Decision criteria:** + * If blocked signals show <40% win rate → Keep threshold at 91 (correct filtering) + * If blocked signals show 50%+ win rate → Lower to 85 (too restrictive) + * If quality 80-84 wins but 85-90 loses → Adjust to 85 threshold +- **Possible outcomes:** Keep 91, lower to 85, adjust ADX/RSI weights, add context filters + ### 2. Position Manager (`lib/trading/position-manager.ts`) **Purpose:** Software-based monitoring loop that checks prices every 2 seconds and closes positions via market orders