From 56e95227406719fba84e83463ecdc70f33ebd6d4 Mon Sep 17 00:00:00 2001 From: mindesbunister Date: Thu, 27 Nov 2025 16:31:05 +0100 Subject: [PATCH] docs: Add MA crossover detection to copilot instructions --- .github/copilot-instructions.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index b8a8681..d7ae112 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1551,7 +1551,7 @@ const { size, leverage } = getActualPositionSizeForSymbol(driftSymbol, config, q ### Execute Trade (Production) ``` -TradingView alert → n8n Parse Signal Enhanced (extracts metrics + timeframe) +TradingView alert → n8n Parse Signal Enhanced (extracts metrics + timeframe + MA crossover flags) ↓ /api/trading/check-risk [validates quality score ≥81, checks duplicates, per-symbol cooldown] ↓ /api/trading/execute ↓ normalize symbol (SOLUSDT → SOL-PERP) @@ -1567,6 +1567,19 @@ TradingView alert → n8n Parse Signal Enhanced (extracts metrics + timeframe) ↓ positionManager.addTrade() [ONLY after DB save succeeds - prevents unprotected positions] ``` +**n8n Parse Signal Enhanced Workflow (Nov 27, 2025):** +- **File:** `workflows/trading/parse_signal_enhanced.json` +- **Extracts from TradingView alerts:** + - Standard metrics: symbol, direction, timeframe, ATR, ADX, RSI, VOL, POS, MAGAP, signalPrice, indicatorVersion + - **MA Crossover Detection (NEW):** `isMACrossover`, `isDeathCross`, `isGoldenCross` flags +- **Detection logic:** Searches for "crossing" keyword (case-insensitive) in alert message + - `isMACrossover = true` if "crossing" found + - `isDeathCross = true` if MA50 crossing below MA200 (short/sell direction) + - `isGoldenCross = true` if MA50 crossing above MA200 (long/buy direction) +- **Purpose:** Enables data collection for MA crossover pattern validation (ADX weak→strong hypothesis) +- **TradingView Alert Setup:** "MA50&200 Crossing" condition, once per bar close, 5-minute chart +- **Goal:** Collect 5-10 crossover examples to validate v9's early detection pattern (signals 35 min before actual cross) + **CRITICAL EXECUTION ORDER (Nov 26, 2025 - Multi-Timeframe Quality Scoring):** Quality scoring MUST happen BEFORE timeframe filtering - this is NOT arbitrary: - All timeframes (5min, 15min, 1H, 4H, Daily) need real quality scores for analysis