Programs / PFG FX Trader / Graphics / Expert Advisors, Custom Indicators and Scripts
Expert Advisors, Custom Indicators and Scripts
Apart from Line Studies and Technical Indicators, the terminal enables to work with additional analytic objects. Among such additional analytic means are:
- Expert Advisors
- Custom Indicators
- Scripts
Expert Advisors
Expert Advisors in client terminal are called the programmes developed in the MetaQuotes Language 4 (MQL 4) programming language that enable to automate analytic and trade operations. Expert Advisors make it possible to carry out a technical market analysis in automatic mode. Besides, Expert Advisors are able, from the signals received, to give orders for execution of trade operations and to control open positions. All routine work concerning carrying out of technical analysis and trade operations can be given to Expert Advisors. A built-in editor "MetaEditor" is used for designing an Expert Advisor. After they have been created, Expert Advisors are stored in the "EXPERTS" folder as files with filename extension "MQ4" (source code) θand "EX4" (executed code). EX4-files list can be viewed in a display window "Navigator Expert Advisors".
Expert Advisor management
In order to create a new Expert Advisor one should load the editor "MetaEditor", open the window "Expert Advisor Wizard" and as a type of the object being created to indicate "Expert Advisor program". "Expert Advisors'" Editor can be called by means of the command of the context menu of the window "Navigator Expert Advisors Create", by command in the menu "Tools MetaQuotes Language Editor" and also by the key F4 or Insert. After that Expert Advisor's general parameters are to be set:
- Name Expert Advisor's name;
- Author information about the author;
- Link developer's site address;
Parameters entry parameters' list. To add a new parameter one should press the key "Add", to delete the key "Delete".
After that Expert Advisor Wizard finished its work and the control passes to the MetaEditor. From this moment it's time to proceed to the direct creation of the advisor. It is possible to change the existing advisor by the command of the advisor's context menu "Navigator - Expert Advisors - Modify". To apply source code modification the advisor should be recompiled.
The wizard can be attached to the chart by command "Attach to a Chart" or by a double-click on the left mouse button on the chosen advisor in the window "Navigator". The technology "Drag'n'Drop" also enables to attach advisors. As an attachment evidence serves an icon (smile) in the right upper corner of the chart. In order to change the settings of the attached Advisor, one should double-click the left mouse button on the smile, perform a command from the context menu "Expert Advisor Properties" or press F7 button.
Advisor's parameters the following settings can be castomized:
- Positions allowed direction of the opening of a position:
- Long&Short in both sides;
- Only Long for buy only;
- Only Short for sale only.
- Enable alerts enable/disable alerts signals;
- Disable alert once hit enable only first alert signal;
- Allow Live trading allow the Advisor to trade in real time;
- Ask manual confirmation ask for confirmation by initiation of a trade signal;
- Allow DLL import enable/disable import of functions from DLL files;
- Confirm DLL functions` call ask for confirmation for each calling of functions from DLL;
- Allow external experts imports enable/disable functions import from external experts;
- Confirm file write ask for confirmation of file writing;
- Confirm send mail ask for confirmation when sending e-mails.
To remove the attached Advisor it is possible to perform a command from the context menu of the chart "Expert Advisors Remove" or lay upon another advisor. The menu command "Tools Options Expert Advisors Enable Expert Advisors", button

"Charts" toolbar and accelerators keys Ctrl+E allow to disable (enable) the usage of all advisors that attached to charts. Here the advisors are not being removed.
Custom Indicators
Custom Indicator is a programme developed on MetaQuotes Language 4 which enables the function of a technical indicator. The editor "MetaEditor" serves for custom indicator design. The custom indicator list can be seen in the window "Navigator Custom Indicators".
Custom Indicator Control
A new user indicator can be created by launching "Expert Advisor Wizard" and choosing "Custom Indicators" as a programme type. Next step of Wizard helps to define general settings of custom indicator:
- Name Custom indicator's name;
- Author information about the author;
- Link developer's site address;
- Parameters input parameters' list;
To add a new parameter one should press the key "Add", to delete the key "Delete". After that it is necessary to define whether the new indicator will be created in a separate window, max and min value (if necessary) and also the amount of the indicator indexes. The values of indicator indexes' members are used to display lines on the chart. In other words, when indicator indexes are defined, custom indicator lines are also defined.
Having defined all characteristics the Wizard finished and transfers the control to "MetaEditor". Modification of custom indicator is similar to advisor modification. The command "Delete" from the context menu deletes custom indicators from the group "Navigator Custom Indicators" window.
Scripts
Script is a programme written on MQL 4 and designed for single function execution. Unlike the advisor, scripts are being held only once (on demand), and not by ticks.
For the script design one can also use "MetaEditor". The list of the available scripts can be viewed in the group of the window "Navigator Scripts". In all other rest, the script control is similar to the control over advisors and custom indicators.
Attention:
- If in the window "Navigator" the programmes' icons are grey in color, one cannot use them. In order to start working with this programmes it is necessary to compile them in the editor MetaEditor.
- In the distributive of the clients' terminal supplied several advisors, user indicators and scripts that demonstrate MQL 4 features. These programmes can be used only for learning.
- After the advisor's modification (custom indicator or script) there is a need for compiling. Otherwise you will not be able to work with modified programm.
Programs / PFG FX Trader / Menu
 |
 |
|
|
 |
Trading
Additional
User interface
|
|
|
 |
 |
|