Compare commits

...

2 Commits

Author SHA1 Message Date
mindesbunister
cc3a0a85a0 docs: Document manual trade quality bypass requirement
User mandate: Manual Telegram trades bypass quality scoring entirely.

Documentation updates:
- Added 'Manual Trade Quality Bypass' section
- Explains user requirement for instant execution
- Documents implementation details (timeframe='manual' detection)
- Clarifies that analytics check is now advisory only
- Notes --force flag no longer needed for manual trades

Context: This is part of the mandatory documentation workflow -
every code change requires corresponding documentation update.

Related commit: 0982578 (quality bypass implementation)
Date: Dec 4, 2025
2025-12-04 19:56:54 +01:00
mindesbunister
09825782bb 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
2025-12-04 19:56:17 +01:00
5 changed files with 1331 additions and 2 deletions

View File

@@ -818,12 +818,23 @@ Frequency penalties (overtrading / flip-flop / alternating) now ignore 1-minute
- Purpose: Enables quick manual entries when TradingView signals unavailable
- Note: Re-entry analytics validate against fresh TradingView data when cached (<5min)
**Re-Entry Analytics System:** Manual trades are validated before execution using fresh TradingView data:
**Manual Trade Quality Bypass (Dec 4, 2025 - USER MANDATE):**
- **User requirement:** "when i say short or long it shall do it straight away and DO it"
- Manual trades (`timeframe='manual'`) bypass ALL quality scoring checks
- Execute endpoint detects `isManualTrade` flag and skips quality threshold validation
- Logs show: `✅ MANUAL TRADE BYPASS: Quality scoring skipped (Telegram command - executes immediately)`
- **Purpose:** Instant execution for user-initiated trades without automated filtering
- **Implementation:** `app/api/trading/execute/route.ts` line ~237-242 (commit 0982578, Dec 4, 2025)
- **Behavior:** Manual trades execute regardless of ADX/ATR/RSI/quality score
- **--force flag:** No longer needed (all manual trades bypass by default)
**Re-Entry Analytics System (OPTIONAL VALIDATION):** Manual trades CAN be validated before execution using fresh TradingView data:
- Market data cached from TradingView signals (5min expiry)
- `/api/analytics/reentry-check` scores re-entry based on fresh metrics + recent performance
- Telegram bot blocks low-quality re-entries unless `--force` flag used
- Uses real TradingView ADX/ATR/RSI when available, falls back to historical data
- Penalty for recent losing trades, bonus for winning streaks
- **Note:** Analytics check is advisory only - manual trades execute even if rejected by analytics
## VERIFICATION MANDATE: Financial Code Requires Proof

View File

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

Binary file not shown.

File diff suppressed because it is too large Load Diff