A script in the MetaTrader4 trading terminal is a small program that performs a one-time action and is disabled.
At the end of this article, you can download the “Close All” script and other scripts for managing multiple positions in the MetaTrader4 trading terminal.
Scripts are very convenient for automating repetitive actions of the same type in the MT4 terminal.
If your trading strategy involves opening a large number of trading positions, averaging or hedging can be extremely inconvenient to manually close a large number of similar transactions. In such cases, Scripts come to your aid.
You can download and install the following scripts:
“Close All” – closes all open positions on the currency pair chart;
“Close Losses” – closes all unprofitable positions on the chart of the currency pair;
“Close Open” – closes all open positions, except for the pending orders placed on the chart of the currency pair;
“Close Pendings” – closes all open pending orders on the chart of the currency pair;
“Close Profits” – closes all profitable positions on the currency pair chart;
In order to start the execution of the Script, it is enough to hold it down with the left mouse button, drag it onto the chart of the currency pair and release the key.
If you double-click on the script in the Navigator menu, it will apply to all charts of currency pairs and all positions in the MT4 terminal.
After executing its function, the script will be automatically removed from the chart.
In the MT4 terminal, scripts are located in the Navigator window after indicators and advisors.
In order to add new scripts to your MT4 trading terminal, you need to copy the script files and paste them into the folder Scripts In chapter MQL4. This action is similar to installing indicators in the terminal, only the scripts are copied to their own folder.
Accordingly, you must remember to reboot the terminal or click the “Refresh” button in the Navigator window after copying the files.
In order for the scripts to be executed by the trading terminal, it is necessary to Settings terminal, set permission for automatic trading (tab Advisers).
Few also know that scripts in the MT4 terminal can be assigned hotkeys. This is done very simply. You need to select a script in the Scripts section in the Navigator window, click right mouse button, select the item “Assign hotkey»(See the picture above) and select the desired key combination.
The scripts of the MT4 trading terminal can greatly facilitate the management of trading positions and make Forex trading much more convenient.
Before working with scripts on a real trading account, install them and test all commands on a test demo account. So, you will be sure that the script performs exactly the action you need and its use will not bring you inconvenience or additional problems.
You can download absolutely free and without registration these useful scripts in a zip archive from the link – Close All Scripts Zip.