feat: Direction-specific adaptive leverage for SHORTs (Q80+, RSI 33+)

- Quality 80-89 + RSI 33+ → 10x leverage (conservative tier)
- Quality 90+ + RSI 33+ → 15x leverage (full confidence tier)
- RSI < 33 penalty: -25 points (drops below Q80 threshold)
- Data-driven: 14 SHORT analysis showed 100% WR at Q80+ RSI33+ (2/2 wins)
- All disasters had RSI < 33 (4 trades, -$665.70 total)
- Modified: config/trading.ts, lib/trading/signal-quality.ts, execute endpoint
- Updated: MIN_SIGNAL_QUALITY_SCORE_SHORT=80 (down from 95)
- Expected impact: +$40.58 vs current system (+216% improvement)
This commit is contained in:
mindesbunister
2025-11-25 12:26:21 +01:00
parent fa3c76c878
commit 439c5a1ee8
4 changed files with 54 additions and 7 deletions

View File

@@ -184,12 +184,14 @@ export async function POST(request: NextRequest): Promise<NextResponse<ExecuteTr
console.log(`📊 Signal quality score: ${qualityResult.score} (calculated early for adaptive leverage)`)
// Get symbol-specific position sizing with quality score for adaptive leverage
// ENHANCED Nov 25, 2025: Pass direction for SHORT-specific leverage tiers
const { getActualPositionSizeForSymbol } = await import('@/config/trading')
const { size: positionSize, leverage, enabled, usePercentage } = await getActualPositionSizeForSymbol(
driftSymbol,
config,
health.freeCollateral,
qualityResult.score // Pass quality score for adaptive leverage
qualityResult.score, // Pass quality score for adaptive leverage
body.direction // Pass direction for SHORT-specific tiers (Q90+=15x, Q80-89=10x)
)
// Check if trading is enabled for this symbol