This section is dedicated to the settings, for the preparation of MetaTrader terminals.
To ensure that all desired MetaTrader 4 terminals are executed, we use the MT4BAR from Fx1.net. Even though further development was discontinued some time ago, this program still runs very stable. MT4BAR monitors all relevant MetaTrader terminals to see if they are running. If the VPS or Windows server is restarted or if one or more terminals crash, the terminals are restarted by MT4BAR. Additionally, you can be notified by email when a terminal is started, so you can check promptly if there is a need for action. Unfortunately, the email notification was poorly implemented or it is already outdated, we could only successfully integrate the outlook.com email service. With many other email providers it failed because of the security settings of the providers. In addition, this program is very well suited to manage all MetaTrader terminals, as they are displayed very clearly. Furthermore, MT4BAR includes an indicator, but it is not mandatory for the described functions.
After installing MT4BAR, a shortcut of this program should be added to the startup folder so that MT4BAR starts automatically with Windows. This is how you can open the folder:
Start > All Programs, then right-click on Startup and select "Open".
The image below shows the Dashboard of MT4BAR as an example.
To use MT4BAR you should watch the short but very informative video.
It may happen that MetaTrader loses connection to the broker's server. This can be fatal, because then the Expert Advisor is no longer able to act and high losses can occur during trading, especially if you have not set a stop loss. See also Our Requirements on Expert Advisors. To ensure that there is always a connection to the broker and if the connection is lost it is restored, we use the Watchdog developed by us. The Watchdog is added to a chart like an Expert Advisor, then it continuously monitors the connection between MetaTrader 4 and the broker. If the connection is lost, it restores it, for this purpose the watchdog uses the broker account added to the favorites. Currently, the Watchdog is only available for MetaTrader 4 and must be set up as follows.
Use the Watchdog on EACH MetaTrader terminal you want to monitor. Add the desired broker account to the Favorites in MetaTrader, please add only one account to the Favorites. To do this, right-click on the account and select "Add to Favorites".
Furthermore, each terminal should be configured so that automated trading is NOT disabled when the account changes. To do this go to "Tools > Options > Expert Advisors" and uncheck the option "Disable automated trading when the account has been changed".
Download the Watchdog for MetaTrader 4.
Now the watchdog can be added to any chart. Make sure that the option "Allow DLL imports" is enabled. Furthermore you can enter the interval in seconds for the connection check under Inputs. With a click on "OK" you activate the watchdog.
Unfortunately, it can happen at any time that the MetaTrader 4 terminal crashes due to a program error. This happens rather rarely, but there is a certain probability, especially if an Expert Advisor causes an error, or if too many Expert Advisors are loaded. The next time the terminal is started (both after a crash and after a proper terminal exit), the profile that is entered in the "lastprofile.ini" file is loaded (by default, the profile with the name "Default" is entered). The MetaTrader terminal will replace the profile with the one that was last loaded after a proper terminal shutdown. When the terminal crashes, this file is not updated, so the next time the terminal is started, the profile that was last used by the user when the terminal crashed is not necessarily loaded. Therefore, one should deal with how to set the desired profile to be loaded both after a proper exit and after a terminal crash.
When MetaTrader 4 terminal is started, the profile that is entered in the "lastprofile.ini" file, located in the "profiles" folder, is always loaded automatically. By default, the profile with the name "Default" is entered. The desired profile, which should be loaded at startup, should best be saved under this name ("Default"), this is the recommended procedure. However, if you want to save a profile, which should be loaded automatically at startup, under a name other than "Default", you can enter the name of the desired profile in the file "lastprofile.ini" or manually close the terminal with the currently loaded profile, this will automatically enter the name of the last profile in the "lastprofile.ini" file (Note: this option only works if the terminal was closed properly by hand, it does not work if the terminal crashed, because the "lastprofile.ini" file is not changed when the terminal crashes).
It is very worthwhile to create a backup of the profile for all MetaTrader terminals. You can do it as follows.
Create a backup of the profile:
- File > Profiles > Save As
- Enter a backup profile name (e. g. "Backup") & click OK
After that, you should load the default profile again. Our tip: Save the profile you just saved under "Default" again, this is faster than loading a profile.
Load the default or backup profile (Better: save as "Default" again):
- File > Profiles
- Select your default or backup profile (e. g. "Backup")
Alternatively, you can use a batch script to create a backup profile from all default profiles. To do this, you have to create a batch file with the following content and adjust the three variables under "Variables" to your needs.
:: Backup Process
for /d /r %_folder_root% %%i in (%_folder_main%) do (
@if exist "%%i" (
rmdir !_pathnew! /s /q
xcopy /e /y !_path! !_pathnew!
You can also download the following batch file and adapt it accordingly: