Effortlessly Close All Open Trades with One Click in MetaTrader 4

Mike 2016.02.17 00:45 33 0 0
Attachments

With just one click, you can close all your open trades (regardless of the currency pair) at once!

This updated version eliminates the previous code that could lead to an infinite loop, which was a common headache for traders.

if(checkOrderClose==false) continue;

Instead, we’ve introduced a robust error control system that stops infinite loops while efficiently closing all your positions.

if(checkOrderClose == false)
         {
         int errorCode = GetLastError();
         
         if (errorCode == 1 || errorCode == 2 || errorCode == 5 || errorCode == 6 || errorCode == 64 || errorCode == 65 || errorCode == 132 || errorCode == 133 || errorCode == 139) break;
         else continue;
         }

List
Comments 0