feat: add indicator version tracking system

Database changes:
- Added indicatorVersion field to Trade table
- Added indicatorVersion field to BlockedSignal table
- Tracks which Pine Script version (v5, v6, etc.) generated each signal

Pine Script changes:
- v6 now includes '| IND:v6' in alert messages
- Enables differentiation between v5 and v6 signals in database

Documentation:
- Created INDICATOR_VERSION_TRACKING.md with full implementation guide
- Includes n8n workflow update instructions
- Includes SQL analysis queries for v5 vs v6 comparison
- Includes rollback plan if needed

Next steps (manual):
1. Update n8n workflow Parse Signal Enhanced node to extract IND field
2. Update n8n HTTP requests to pass indicatorVersion
3. Update API endpoints to accept and save indicatorVersion
4. Rebuild Docker container

Benefits:
- Compare v5 vs v6 Pine Script effectiveness
- Track which version generated winning/losing trades
- Validate that v6 price position filter reduces blocked signals
- Data-driven decisions on Pine Script improvements
This commit is contained in:
mindesbunister
2025-11-11 12:53:33 +01:00
parent 871d82a64a
commit 0700daf8ff
3 changed files with 234 additions and 4 deletions

View File

@@ -77,7 +77,8 @@ model Trade {
volumeAtEntry Float? // Volume relative to MA
pricePositionAtEntry Float? // Price position in range (0-100%)
signalQualityScore Int? // Calculated quality score (0-100)
signalQualityVersion String? @default("v1") // Tracks which scoring logic was used
signalQualityVersion String? @default("v4") // Tracks which scoring logic was used
indicatorVersion String? // Pine Script version (v5, v6, etc.)
fundingRateAtEntry Float? // Perp funding rate at entry
basisAtEntry Float? // Perp-spot basis at entry
@@ -177,6 +178,7 @@ model BlockedSignal {
signalQualityVersion String? // Which scoring version
scoreBreakdown Json? // Detailed breakdown of score components
minScoreRequired Int // What threshold was used (e.g., 65)
indicatorVersion String? // Pine Script version (v5, v6, etc.)
// Block reason
blockReason String // "QUALITY_SCORE_TOO_LOW", "DUPLICATE", "COOLDOWN", etc.