Commit Graph

6 Commits

Author SHA1 Message Date
mindesbunister
04e1610806 fix: Add missing analysis completion flag to enhanced screenshot API
- Add analysisCompletionFlag.startAnalysisCycle() at the beginning of screenshot API
- Add analysisCompletionFlag.markAnalysisComplete() at the end of screenshot API
- This ensures cleanup system can properly detect when analysis is complete
- Fixes issue where cleanup was always skipped due to analysis appearing to still be running
- Critical for preventing Chromium process accumulation during screenshot automation

The enhanced screenshot API was missing completion flag logic that automation service has,
causing cleanup to never trigger properly.
2025-07-24 11:24:28 +02:00
mindesbunister
71e1a64b5d fix: correct entry prices and position sizing in trading system
- Fixed automation service to use real SOL price (~89) instead of hardcoded 00
- Updated position size calculation to properly convert USD investment to token amount
- Enhanced trade display to show separate entry/exit prices with price difference
- Added data quality warnings for trades with missing exit data
- Updated API to use current SOL price (189.50) and improved trade result determination
- Added detection and warnings for old trades with incorrect price data

Resolves issue where trades showed 9-100 entry prices instead of real SOL price of 89
and position sizes of 2.04 SOL instead of correct ~0.53 SOL for 00 investment
2025-07-21 09:26:48 +02:00
mindesbunister
6ce4f364a9 feat: Automation-Enhanced Manual Analysis System
Multi-timeframe Intelligence Integration:
- Fixed route.js conflicts preventing multi-timeframe display (2h, 4h now show)
- API now returns multiTimeframeResults with real database sessions
- Multi-timeframe consensus: 4h (82% confidence), 2h (78% confidence)

- Enhanced screenshot API with automation insights context
- New /api/automation-insights endpoint for standalone intelligence
- Pattern recognition from successful automated trades
- Multi-timeframe consensus recommendations

- Historical win rates and profitability patterns (70% win rate, avg 1.9% profit)
- Market trend context from automated sessions (BULLISH consensus)
- Confidence levels based on proven patterns (80% avg confidence)
- Top performing patterns: BUY signals with 102% confidence

- automationContext passed to analysis services
- generateEnhancedRecommendation() with multi-timeframe logic
- Enhanced progress tracking with automation insights step
- Real database integration with prisma for trade patterns

- Resolved Next.js route file conflicts in analysis-details directory
- Multi-timeframe sessions properly grouped and returned
- Automation insights included in API responses
- Enhanced recommendation system with pattern analysis

- Manual analysis now has access to automated trading intelligence
- Multi-timeframe display working (1h, 2h, 4h timeframes)
- Data-driven recommendations based on historical performance
- Seamless integration between automated and manual trading systems
2025-07-20 21:46:22 +02:00
mindesbunister
74b0087f17 feat: implement on-demand cleanup triggered after analysis completion
- Replace time-based cleanup with on-demand cleanup in development mode
- Cleanup is triggered immediately after AI analysis completes
- Added runPostAnalysisCleanup() method to aggressive-cleanup service
- Cleanup triggers added to both single and batch analysis endpoints
- More efficient: cleanup happens only when needed, not on timer
- Prevents zombie processes without interfering with active analysis
- Production mode still uses periodic cleanup as backup (10 min intervals)
- Gentle cleanup in development: SIGTERM first, then SIGKILL if needed
2025-07-18 19:11:15 +02:00
mindesbunister
ff4e9737fb fix: timeframe handling and progress tracking improvements
- Fix timeframe parameter handling in enhanced-screenshot API route
- Support both 'timeframe' (singular) and 'timeframes' (array) parameters
- Add proper sessionId propagation for real-time progress tracking
- Enhance MACD analysis prompt with detailed crossover definitions
- Add progress tracker service with Server-Sent Events support
- Fix Next.js build errors in chart components (module variable conflicts)
- Change dev environment port from 9000:3000 to 9001:3000
- Improve AI analysis layout detection logic
- Add comprehensive progress tracking through all service layers
2025-07-17 10:41:18 +02:00
mindesbunister
de45349baa Restore working dashboard and TradingView analysis
- Fixed layout conflicts by removing minimal layout.tsx in favor of complete layout.js
- Restored original AI Analysis page with full TradingView integration
- Connected enhanced screenshot API to real TradingView automation service
- Fixed screenshot gallery to handle both string and object formats
- Added image serving API route for screenshot display
- Resolved hydration mismatch issues with suppressHydrationWarning
- All navigation pages working (Analysis, Trading, Automation, Settings)
- TradingView automation successfully capturing screenshots from AI and DIY layouts
- Docker Compose v2 compatibility ensured

Working features:
- Homepage with hero section and status cards
- Navigation menu with Trading Bot branding
- Real TradingView screenshot capture
- AI-powered chart analysis
- Multi-layout support (AI + DIY module)
- Screenshot gallery with image serving
- API endpoints for balance, status, screenshots, trading
2025-07-14 14:21:19 +02:00