Files
trading_bot_v3/app/api/automation/start/route.js
mindesbunister 0e3baa139f Fix automation system and AI learning integration
Fixed automation v2 start button (relative API URLs)
 Fixed batch analysis API endpoint in simple-automation
 Fixed AI learning storage with correct userId
 Implemented comprehensive learning data storage
 Fixed parallel analysis system working correctly

- Changed frontend API calls from localhost:9001 to relative URLs
- Updated simple-automation to use localhost:3000 for batch analysis
- Fixed learning integration with 'default-user' instead of 'system'
- AI learning now stores analysis results with confidence/recommendations
- Batch analysis working: 35s completion, 85% confidence, learning stored
- True parallel screenshot system operational (6 screenshots when multi-timeframe)
- Automation start/stop functionality fully working
2025-07-24 22:56:16 +02:00

27 lines
730 B
JavaScript

import { NextResponse } from 'next/server';
import { simpleAutomation } from '@/lib/simple-automation';
export async function POST(request) {
try {
const config = await request.json();
console.log('🚀 AUTOMATION START: Received config:', JSON.stringify(config, null, 2));
const result = await simpleAutomation.start(config);
if (result.success) {
return NextResponse.json(result);
} else {
return NextResponse.json(result, { status: 400 });
}
} catch (error) {
console.error('Start automation error:', error);
return NextResponse.json({
success: false,
error: 'Internal server error',
message: error.message
}, { status: 500 });
}
}