#!/usr/bin/env node // Quick automation status checker const { exec } = require('child_process'); const { promisify } = require('util'); const execAsync = promisify(exec); async function checkStatus() { console.log('πŸ€– 24/7 AUTOMATION STATUS CHECK\n'); try { // Check if process is running const { stdout } = await execAsync('ps aux | grep "working-24x7" | grep -v grep'); if (stdout.trim()) { console.log('βœ… AUTOMATION STATUS: RUNNING'); console.log(`πŸ“Š Process: ${stdout.trim().split(/\s+/).slice(0, 11).join(' ')}`); } else { console.log('❌ AUTOMATION STATUS: NOT RUNNING'); return; } } catch (error) { console.log('❌ AUTOMATION STATUS: NOT RUNNING'); return; } try { // Check recent logs const { stdout: logs } = await execAsync('tail -5 nohup.out'); console.log('\nπŸ“ RECENT LOGS:'); console.log(logs); } catch (error) { console.log('\n⚠️ No logs available'); } try { // Check current analysis const { stdout } = await execAsync('curl -s "http://localhost:9001/api/ai-analysis/latest?symbol=SOLUSD&timeframe=60"'); const data = JSON.parse(stdout); if (data.success && data.data && data.data.analysis) { const analysis = data.data.analysis; console.log('\nπŸ“Š CURRENT ANALYSIS:'); console.log(` Signal: ${analysis.recommendation}`); console.log(` Confidence: ${analysis.confidence}%`); console.log(` Entry: $${analysis.entry}`); console.log(` Status: ${analysis.confidence >= 60 ? '🎯 WILL AUTO-EXECUTE' : '⏸️ Below threshold'}`); } else { console.log('\n❌ No analysis data available'); } } catch (error) { console.log('\n❌ Analysis check failed:', error.message); } try { // Check recent paper trades const { stdout } = await execAsync('curl -s "http://localhost:9001/api/safe-paper-trading/create-trade"'); const data = JSON.parse(stdout); if (data.success && data.trades) { console.log('\nπŸ“„ PAPER TRADES:'); console.log(` Total: ${data.summary.total}`); console.log(` Open: ${data.summary.open}`); console.log(` Closed: ${data.summary.closed}`); console.log(` P&L: $${data.summary.totalPnL}`); // Show recent trades const recentTrades = data.trades.slice(-3); if (recentTrades.length > 0) { console.log('\nπŸ“ˆ RECENT TRADES:'); recentTrades.forEach(trade => { console.log(` ${trade.id}: ${trade.side} ${trade.symbol} @ $${trade.entry} (${trade.confidence}%)`); }); } } } catch (error) { console.log('\n⚠️ Could not check paper trades'); } console.log('\n🎯 AUTOMATION CONFIGURATION:'); console.log(' Symbol: SOLUSD'); console.log(' Timeframe: 1 hour'); console.log(' Interval: Every 60 minutes'); console.log(' Auto-execute: β‰₯60% confidence'); console.log(' Mode: Safe paper trading only'); console.log('\n✨ System is running 24/7 in your Docker container!'); } checkStatus();