Knowledge >> Check before you ask

Check before you ask

This article presents the most common pitfalls when using expert advisors and other programs for the first time. Please check all the following points before you ask why your program does not work.

If you need more information, I can also recommend a very detailed article about Troubleshooting Expert Advisors on MetaTrader 4.

Metatrader 4 directories

First of all, you need to know that Metatrader 4 requires only .ex4 files. All .mq4 files are source code files which allow to modify the program and compile it later into .ex4. However, you only need to put your .ex4 files in the proper directories in order to run your programs.

Correct directories for different programs for new versions of Metatrader 4 (Metatrader builds above 509):

All above folders are located somewhere in your system. In order to find them click on Files->Open Data Folder in Metatrader's main menu.

Turning EAs on

There is a big Expert Advisors button on the Metatrader toolbar. It should be switched on, if you want to use expert advisors. Otherwise they will not be able to trade.

Expert Advisors button

Attaching programs to the chart

In order to attach your EA to the chart, just drag it from the Expert advisors sections of the Navigator window to the chart. Make sure that the chart has the right timeframe and symbol. Do the same for other kinds of programs: scripts and custom indicators. They can be found in the corresponding sections of the Navigator window. If you can't find your program, restart Metatrader and try again.

Navigator

EA settings

When trying to attach the EA to the chart, you will see the settings window appearing. Make sure the following options are marked:

EA settings

Check the face

If all the above steps have been made, a small smiling face should appear in the upper right corner of the chart, right next to the EA name. If the face is not smiling (it is sad), it means something is wrong and the EA won't work properly.

Face

Check the logs

In case of any problems, you should look through the Experts and Journal tabs of the terminal. Sometimes you may find very useful information there.

Logs in terminal

Version mismatch

A program built (compiled) with the newer version of Metatrader may not work with the older version. In such case you have two options:

In order to recompile your program you need to place its source code files in proper folders:

Then open your main source code file (.mq4) with Metaeditor and click the Compile button. If there are no errors, a message about successful compilation will appear and a new executable file (.ex4) will be created in the same folder.

Try your EA on the Strategy Tester

If you feel that your EA does not work properly, try it on the built-in Strategy Tester. It saves much time when testing Expert Advisors. You don't have to wait for a trading signal to occur and trigger the trade. Whole days can be tested within minutes. Strategy Tester can be turned on by selecting View->Strategy Tester. It is also very useful to enable Visual Mode to actually see the entry and exit points of your EA on the chart.

Strategy Tester

If all the above steps fail, you should contact the author of the program and describe your problem. Include as much information as possible. The following information should be given: