Fix MT4 EA Autotrade Bug

Customer: AI | Published: 01.10.2025
Бюджет: 250 $

My MT4 Expert Advisor is built to watch a Moving Averages crossover and, once that custom-indicator signal meets my rules, disable the platform’s Autotrade button and immediately close every open position. Disabling the button works, but the EA occasionally leaves positions floating instead of closing them, defeating the whole safety logic. I need the code reviewed and corrected so that, every single time Autotrade is switched off by the EA, all trades are closed without exception and without delay. The logic based on the specific trading conditions must stay exactly as it is—I only want the shutdown-and-close sequence to be 100 % reliable. Please work directly in MQL4, return the fixed source file plus the compiled EX4, and let me know what you changed so I can learn from it. A short test report showing the EA closing positions consistently after the Moving Averages crossover trigger will finish the job.