feat: Bypass quality scoring for manual Telegram trades
User requirement: Manual long/short commands via Telegram shall execute immediately without quality checks. Changes: - Execute endpoint now checks for timeframe='manual' flag - Added isManualTrade bypass alongside isValidatedEntry bypass - Manual trades skip quality threshold validation completely - Logs show 'MANUAL TRADE BYPASS' for transparency Impact: Telegram commands (long sol, short eth) now execute instantly without being blocked by low quality scores. Commit: Dec 4, 2025
This commit is contained in:
@@ -234,15 +234,25 @@ export async function POST(request: NextRequest): Promise<NextResponse<ExecuteTr
|
||||
// Solution: If validatedEntry=true flag present, bypass quality check (signal already validated by queue)
|
||||
const isValidatedEntry = body.validatedEntry === true
|
||||
|
||||
// CRITICAL FIX (Dec 4, 2025): Manual Telegram trades bypass quality scoring
|
||||
// User requirement: "when i say short or long it shall do it straight away and DO it"
|
||||
// Manual trades (timeframe='manual') execute immediately without quality checks
|
||||
const isManualTrade = timeframe === 'manual'
|
||||
|
||||
if (isValidatedEntry) {
|
||||
console.log(`✅ VALIDATED ENTRY BYPASS: Quality ${qualityResult.score} accepted (validated by Smart Entry Queue)`)
|
||||
console.log(` Original quality: ${body.originalQualityScore}, Validation delay: ${body.validationDelayMinutes}min`)
|
||||
}
|
||||
|
||||
if (isManualTrade) {
|
||||
console.log(`✅ MANUAL TRADE BYPASS: Quality scoring skipped (Telegram command - executes immediately)`)
|
||||
}
|
||||
|
||||
// CRITICAL FIX (Nov 27, 2025): Verify quality score meets minimum threshold
|
||||
// Bug: Quality 30 trade executed because no quality check after timeframe validation
|
||||
// ENHANCED (Dec 3, 2025): Skip this check if validatedEntry=true (already validated by queue)
|
||||
if (!isValidatedEntry && qualityResult.score < minQualityScore) {
|
||||
// ENHANCED (Dec 4, 2025): Skip this check if isManualTrade=true (Telegram commands execute immediately)
|
||||
if (!isValidatedEntry && !isManualTrade && qualityResult.score < minQualityScore) {
|
||||
console.log(`❌ QUALITY TOO LOW: ${qualityResult.score} < ${minQualityScore} threshold for ${body.direction.toUpperCase()}`)
|
||||
console.log(` Reasons: ${qualityResult.reasons.join(', ')}`)
|
||||
return NextResponse.json({
|
||||
|
||||
BIN
cluster/__pycache__/v9_advanced_coordinator.cpython-37.pyc
Normal file
BIN
cluster/__pycache__/v9_advanced_coordinator.cpython-37.pyc
Normal file
Binary file not shown.
Binary file not shown.
1308
docs/analysis/COMPREHENSIVE_IMPROVEMENT_PLAN_DEC2025.md
Normal file
1308
docs/analysis/COMPREHENSIVE_IMPROVEMENT_PLAN_DEC2025.md
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user