Commit Graph

3 Commits

Author SHA1 Message Date
mindesbunister
049ecb0265 Fix presets to match frontend UI exactly
FRONTEND PRESET CORRECTIONS:
- Scalp Trading: 5m, 15m, 30m (was 5m, 15m) → 3 timeframes
- Day Trading: 1h, 2h (was 1h, 4h) → 2 timeframes
- Swing Trading: 4h, 1D (correct) → 2 timeframes

UPDATED FILES:
- lib/superior-screenshot-service.ts → Correct timeframe definitions
- lib/auto-trading-service.ts → TRADING_CONFIGS match frontend
- app/api/superior-screenshot/route.js → API presets corrected
- Verification and test scripts updated

PERFORMANCE ESTIMATES:
- Scalp (3 timeframes): ~90s → ~30-40s parallel
- Day Trading (2 timeframes): ~60s → ~20-30s parallel
- Swing Trading (2 timeframes): ~60s → ~20-30s parallel
- Extended (9 timeframes): ~270s → ~70-100s parallel

System now matches frontend UI exactly with superior parallel capture!
2025-07-26 12:30:51 +02:00
mindesbunister
0087490386 Integrate superior parallel screenshot system into main automation
BREAKING CHANGES:
- Replace enhancedScreenshotService with superiorScreenshotService throughout system
- Update trading presets to match actual strategy definitions:
  * Scalp: 5m, 15m (was 7 timeframes)
  * Day Trading: 1h, 4h (NEW)
  * Swing Trading: 4h, 1D (NEW)
  * Extended: All timeframes for comprehensive analysis
- Auto-trading service now uses intelligent parallel capture
- Enhanced-screenshot API restored with superior backend
- AI analysis service updated for compatibility
- Superior screenshot API supports all presets

PERFORMANCE IMPROVEMENTS:
- Parallel capture for ALL timeframes regardless of count
- Intelligent preset detection based on timeframe patterns
- No more hardcoded 7-timeframe limitation
- Backwards compatibility maintained

The system now uses the superior parallel approach for ANY timeframe selection,
whether it's 2 timeframes (scalp/day/swing) or 8+ timeframes (extended).
No more sequential delays - everything is parallel!
2025-07-26 12:24:30 +02:00
mindesbunister
5b156a0063 🔧 Implement robust cleanup system for Chromium process management
Major fixes for browser automation resource management:

- Chromium processes accumulating over time during automated trading
- Resource consumption growing after extended automation cycles
- Incomplete cleanup during analysis operations

 New Components:
- lib/enhanced-screenshot-robust.ts: Screenshot service with guaranteed cleanup
- lib/automated-cleanup-service.ts: Background process monitoring
- lib/auto-trading-service.ts: Comprehensive trading automation
- ROBUST_CLEANUP_IMPLEMENTATION.md: Complete documentation

- Finally blocks guarantee cleanup execution even during errors
- Active session tracking prevents orphaned browser instances
- Multiple kill strategies (graceful → force → process cleanup)
- Timeout protection prevents hanging cleanup operations
- Background monitoring every 30s catches missed processes

- lib/aggressive-cleanup.ts: Improved with multiple cleanup strategies
- app/api/enhanced-screenshot/route.js: Added finally block guarantees
- lib/automation-service.ts: Updated for integration

- validate-robust-cleanup.js: Implementation validation
- test-robust-cleanup.js: Comprehensive cleanup testing

The Chromium process accumulation issue is now resolved with guaranteed cleanup!
2025-07-24 08:39:26 +02:00