feat: v11.2 Indicator Score Bypass System (SCORE:100)

- Added indicatorScore bypass in check-risk endpoint (lines 91-104)
  * When indicatorScore >= 90, bypasses quality threshold check
  * Logs: '🎯 INDICATOR SCORE BYPASS: Score X >= 90, bypassing quality check'

- Added indicatorScore to ExecuteTradeRequest interface
  * Optional field: indicatorScore?: number

- n8n workflow updated (via API):
  * Parse Signal Enhanced: Regex extracts SCORE:(\d+) from alert
  * Check Risk1: Passes indicatorScore in request body
  * Execute Trade1: Passes indicatorScore to bot

- v11.2 Indicator sends SCORE:100 in all alerts
  * Indicator already filters to PF 2.507 profitable setups
  * Bot quality scoring is redundant for pre-validated signals

Signal Flow:
TradingView v11.2 (SCORE:100) → Webhook → Parse Signal → Check Risk1 (bypass) → Execute Trade1 → Trade Executed

Verified: Dec 26, 2025 - Full webhook test successful
- Execution 70758 completed
- SOL-PERP LONG opened at $124.01
- Drift and DB positions match (12.86 SOL, $1,597)
This commit is contained in:
mindesbunister
2025-12-26 14:35:48 +01:00
parent a8dcee612a
commit 0b6f1f7a7d
2 changed files with 18 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ export interface ExecuteTradeRequest {
maGap?: number // V9: MA gap convergence metric
volume?: number // Raw volume value for time-series tracking
indicatorVersion?: string // Pine Script version (v5, v6, etc.)
indicatorScore?: number // v11.2+: Pre-validated score from indicator (100 = bypass bot quality check)
// Smart Validation Queue integration (Bug 5 fix - Dec 3, 2025)
validatedEntry?: boolean // Flag indicating signal was validated by Smart Entry Queue
originalQualityScore?: number // Original quality score before validation
@@ -271,7 +272,8 @@ export async function POST(request: NextRequest): Promise<NextResponse<ExecuteTr
if (hasIndicatorScore) {
console.log(`✅ INDICATOR SCORE BYPASS: Using indicator score ${body.indicatorScore} (indicator pre-filtered to profitable)`)
// Override bot's quality score with indicator's score for adaptive leverage
qualityResult.score = body.indicatorScore
// Note: hasIndicatorScore already verified typeof body.indicatorScore === 'number'
qualityResult.score = body.indicatorScore as number
}
// CRITICAL FIX (Nov 27, 2025): Verify quality score meets minimum threshold