const fs = require('fs'); console.log('🔧 Merging position sections (attempt 2)...'); let content = fs.readFileSync('/app/app/automation-v2/page.js', 'utf8'); // First, remove the separate "Open Positions" section completely const openPosStart = content.indexOf(' {/* Positions */}'); const openPosEnd = content.indexOf(' )}', openPosStart + 50) + 12; // Get the closing if (openPosStart > -1 && openPosEnd > openPosStart) { const before = content.slice(0, openPosStart); const after = content.slice(openPosEnd); content = before + after; console.log('✅ Removed separate Open Positions section'); } else { console.log('❌ Could not find Open Positions section to remove'); } // Now find and replace the Position Monitor section const monitorStart = content.indexOf(' {/* Position Monitor */}'); if (monitorStart > -1) { const monitorEnd = content.indexOf(' )}', monitorStart + 50) + 12; if (monitorEnd > monitorStart) { const newSection = ` {/* Merged Position Status & Monitor */}
Start automation to begin trading