import { NextResponse } from 'next/server' import { automationService } from '../../../../lib/automation-service-simple' export async function GET() { try { // Get status from the automation service directly (includes timing and individual results) const status = await automationService.getStatus() if (!status) { return NextResponse.json({ success: true, status: { isActive: false, mode: 'SIMULATION', symbol: 'SOLUSD', timeframe: '1h', totalTrades: 0, successfulTrades: 0, winRate: 0, totalPnL: 0, errorCount: 0, nextAnalysisIn: 0, analysisInterval: 3600, currentCycle: 0, individualTimeframeResults: [] } }) } return NextResponse.json({ success: true, status: status }) } catch (error) { console.error('Automation status error:', error) return NextResponse.json({ success: false, error: 'Failed to get automation status' }, { status: 500 }) } }