MQL4 Reference MQL4 programs
For the mql4-program to operate, it must be compiled (Compile button or F7 key). Compilation should pass without errors (some warnings are possible; they should be analyzed). At this process, an executable file with the same name and with EX4 extension must be created in the corresponding directory, terminal_dir\MQL4\Experts, terminal_dir\MQL4\indicators or terminal_dir\MQL4\scripts. This file can be run.
Operating features of MQL4 programs are described in the following sections:
Expert Advisors, custom indicators and scripts are attached to one of opened charts by Drag'n'Drop method from the Navigator window.
For an expert Advisor to stop operating, it should be removed from a chart. To do it select "Expert list" in chart context menu, then select an Expert Advisor from list and click "Remove" button. Operation of Expert Advisors is also affected by the state of the "AutoTrading" button.
In order to stop a custom indicator, it should be removed from a chart.
Custom indicators and Expert Advisors work until they are explicitly removed from a chart; information about attached Expert Advisors and Indicators is saved between client terminal sessions.
Scripts are executed once and are deleted automatically upon operation completion or change of the current chart state, or upon client terminal shutdown. After the restart of the client terminal scripts are not started, because the information about them is not saved.
Maximum one Expert Advisor, one script and unlimited number of indicators can operate in one chart.
What's new in MQL5
In MQL5, the entire program logic is based on handling events. The event handling functions allow you to develop trading algorithms, create user interfaces, as well as collect and visualize optimization results. The number of events has increased. The five most important ones are as follows:
Developers of trading robots will appreciate the new tester features described in the articles and documentation. The most notable advantages are as follows: