diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 5d10d77..c70c766 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -34,7 +34,7 @@ --- -## 🎯 CURRENT ACTIVE SYSTEM (Dec 17, 2025) - MANDATORY REFERENCE +## 🎯 CURRENT ACTIVE SYSTEM (Dec 26, 2025) - MANDATORY REFERENCE **⚠️ CRITICAL: Always check this section first to know what's currently deployed in production** @@ -56,6 +56,7 @@ * Entry Buffer: -0.15 ATR (negative = early entry) * Long Position Max: 85%, Short Position Min: 5% * Volume Filter: OFF + * **SCORE:100** - Indicator sends quality score 100 to bypass bot filtering - **v11 All Filters Parameters (Exhaustive Sweep Optimal):** * Flip Threshold: 0.15% * ADX Minimum: 5 (26,244 config sweep optimal) @@ -63,21 +64,41 @@ * RSI SHORT: 30-70 * Entry Buffer: 0.10 ATR - **Filter Logic:** `finalLongSignal = buyReady and longOk and adxOk and longBufferOk and rsiLongOk and longPositionOk and volumeOk` -- **Last Updated:** Dec 17, 2025 (v11.2 improved created - commit 178348d) +- **Last Updated:** Dec 26, 2025 (indicator score bypass implemented - commits ba1fe44) - **See:** `V11_COMPREHENSIVE_ANALYSIS_DEC17_2025.md` for complete 7-trade performance breakdown -- **⚠️ Note:** Database shows "v11" in recent trades - user should verify which indicator is actually loaded in TradingView + +### Indicator Score Bypass System (Dec 26, 2025 - NEW) +- **Purpose:** v11.2 indicator already filters to 2.507 PF profitable setups - bot quality scoring is redundant +- **Implementation:** + * Indicator sends `SCORE:100` in alert message + * n8n Parse Signal Enhanced extracts `indicatorScore` via regex `SCORE:(\d+)` + * n8n Execute Trade1 passes `indicatorScore` to bot endpoint + * Bot execute endpoint: If `indicatorScore >= 90`, bypasses quality check entirely +- **Rationale:** Two-layer filtering was counterproductive - indicator already validates profitability +- **n8n Workflow:** Money Machine (ID: gUDqTiHyHSfRUXv6) updated Dec 26, 2025 +- **Files Changed:** + * `workflows/trading/moneyline_v11_2_indicator.pinescript` - Sends SCORE:100 + * `workflows/trading/parse_signal_enhanced.json` - Parses indicatorScore + * `workflows/trading/Money_Machine.json` - Passes indicatorScore + * `app/api/trading/execute/route.ts` - Bypasses quality check when indicatorScore >= 90 +- **Signal Flow:** + ``` + TradingView v11.2 (SCORE:100) → Webhook → Parse Signal → Execute Trade1 → Bot (bypass) → Trade Executed + ``` +- **Git Commits:** ba1fe44 (local files), n8n API update Dec 26, 2025 10:58 UTC ### Signal Quality Scoring (Bot-Side Filtering) - **Active Version:** v9 Quality Scoring with Direction-Specific Thresholds - **File:** `lib/trading/signal-quality.ts` -- **Status:** ✅ PRODUCTION +- **Status:** ✅ PRODUCTION (but BYPASSED when indicatorScore >= 90) - **Direction-Specific Thresholds:** * **LONG signals:** Quality ≥90 required (higher bar due to bull market bias) * **SHORT signals:** Quality ≥80 required (more permissive, harder to short tops) - **Quality Score Calculation:** 0-100 based on 5 metrics (ATR, ADX, RSI, volumeRatio, pricePosition) - **Timeframe-Aware:** Adjusts thresholds for 5min vs daily charts - **Configuration:** `MIN_SIGNAL_QUALITY_SCORE_LONG=90`, `MIN_SIGNAL_QUALITY_SCORE_SHORT=80` in .env -- **Last Updated:** Nov 28, 2025 (direction-specific thresholds implemented) +- **Bypass Logic:** When `indicatorScore >= 90`, quality check is skipped (indicator already filtered) +- **Last Updated:** Dec 26, 2025 (indicator score bypass added) ### Position Management & Exit Strategy - **Active System:** TP2-as-Runner with ATR-Based Dynamic Targets