Download MetaTrader 5

Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2016.02.16 15:45
1 Click Button To Close All Open Positions

1 Click Button To Close All Open Positions - expert for MetaTrader 4

| English Español Português 日本語 Deutsch Русский

votes: 20

Click "Close All" button to close all your open positions (regardless of the pair) at once.

This new version doesn't contain the code written below that previous versions had which may cause an infinite loop.

if(checkOrderClose==false) continue;

but instead brings an error control system to prevent an infinite loop while still closing all trades.

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;        

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

Average Directional Movement Index (ADX) Average Directional Movement Index (ADX)

The Average Directional Movement Index Indicator (ADX) helps to determine if there is a price trend.

LinesProfitLoss LinesProfitLoss

Calculates profit (loss) of the current orders on the symbol.

FFC - Forex Factory Calendar FFC - Forex Factory Calendar

Modified version of FF Calendar Indicator with new features.