Features Added: - 🤖 Autonomous AI Risk Management System - 🛡️ Smart Stop Loss Proximity Monitoring - 📊 Real-time Position Monitor with Dark Theme - 🚨 Emergency Stop Buttons on All Pages - 🏖️ Full Beach Mode Operation - Emergency exit analysis (< 1% from SL) - Position review and adjustments (1-2% from SL) - Enhanced monitoring (2-5% from SL) - Opportunity scanning (> 5% from SL) - Beautiful dark theme Position Monitor - Emergency stop buttons on automation pages - Real-time P&L tracking with trend indicators - Beach mode demo script - Autonomous risk manager integration - Position monitoring API endpoints - Enhanced automation with AI leverage calculator - CLI monitoring tools with enhanced display Now you can truly relax on the beach while your AI handles everything! 🏖️🤖💰
27 lines
763 B
JavaScript
27 lines
763 B
JavaScript
import { positionAwareAutomation } from '@/lib/position-aware-automation';
|
|
|
|
export async function POST() {
|
|
try {
|
|
console.log('🛑 AUTOMATION STOP: Request received');
|
|
|
|
const result = await positionAwareAutomation.stop();
|
|
|
|
// Additional cleanup
|
|
try {
|
|
const { execSync } = require('child_process');
|
|
execSync('pkill -f "chrome|chromium" 2>/dev/null || true');
|
|
console.log('✅ Additional cleanup completed');
|
|
} catch (cleanupError) {
|
|
console.error('Cleanup error:', cleanupError.message);
|
|
}
|
|
|
|
return Response.json(result);
|
|
} catch (error) {
|
|
console.error('Stop automation error:', error);
|
|
return Response.json({
|
|
success: false,
|
|
message: error.message
|
|
}, { status: 500 });
|
|
}
|
|
}
|