feat: Enhanced timeframe extraction for multi-timeframe data collection

Updated n8n Parse Signal Enhanced to support multiple timeframe formats:
- 5m, 15m timeframes (buy 5, buy 15)
- Hourly: buy 60, buy 1h → 60
- 4-hour: buy 240, buy 4h → 240
- Daily: buy D, buy 1d → D
- Weekly/Monthly: buy W, buy M

Fixes:
- Default timeframe changed from '15' to '5' (5min is production)
- Added indicator version extraction (IND:v8)
- Proper conversion of hour/day notation to minutes
- Case-insensitive matching for D/W/M

Related: Multi-timeframe data collection system (execute endpoint saves
non-5min signals to BlockedSignal for cross-timeframe analysis). Now
15min signals from TradingView will be properly parsed and saved.

Files:
- workflows/trading/parse_signal_enhanced.json (updated regex + conversion)
- .github/copilot-instructions.md (documented supported formats)
This commit is contained in:
mindesbunister
2025-11-19 10:33:12 +01:00
parent df6c388639
commit f65af9530f
2 changed files with 9 additions and 2 deletions

View File

@@ -2733,7 +2733,7 @@ See `POSITION_SCALING_ROADMAP.md` for planned position management optimizations:
**Blocked Signals Tracking (Nov 11, 2025):** System now automatically saves all blocked signals to database for data-driven optimization. See `BLOCKED_SIGNALS_TRACKING.md` for SQL queries and analysis workflows.
**Multi-Timeframe Data Collection (Nov 18, 2025):** Execute endpoint now supports parallel data collection across timeframes:
**Multi-Timeframe Data Collection (Nov 18-19, 2025):** Execute endpoint now supports parallel data collection across timeframes:
- **5min signals:** Execute trades (production)
- **15min/1H/4H/Daily signals:** Save to BlockedSignal table with `blockReason='DATA_COLLECTION_ONLY'`
- Enables cross-timeframe performance comparison (which timeframe has best win rate?)
@@ -2741,6 +2741,13 @@ See `POSITION_SCALING_ROADMAP.md` for planned position management optimizations:
- TradingView alerts on multiple timeframes → n8n passes `timeframe` field → bot routes accordingly
- After 50+ trades: SQL analysis to determine optimal timeframe for live trading
- Implementation: `app/api/trading/execute/route.ts` lines 106-145
- **n8n Parse Signal Enhanced (Nov 19):** Supports multiple timeframe formats:
- `"buy 5"` → `"5"` (5 minutes)
- `"buy 15"` → `"15"` (15 minutes)
- `"buy 60"` or `"buy 1h"` → `"60"` (1 hour)
- `"buy 240"` or `"buy 4h"` → `"240"` (4 hours)
- `"buy D"` or `"buy 1d"` → `"D"` (daily)
- Extracts indicator version from `IND:v8` format
**Data-driven approach:** Each phase requires validation through SQL analysis before implementation. No premature optimization.