docs: Add MA crossover detection to copilot instructions

This commit is contained in:
mindesbunister
2025-11-27 16:31:05 +01:00
parent ad3eb9841f
commit 56e9522740

View File

@@ -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