Automated trading system. Expert Advisors, scripts and mt4 custom indicators

Automated options allow to configure the trading system of your dream. Let's start from Expert Advisors (EA)

In the MT4 terminal advisors or experts are the programs, which help to automate analytical and trade operations. Ea trading allows to carry out technical analysis in an automatic mode. Moreover, based on received signals, ea can produce trading command and manage open positions. Generally, advisors are supposed to be in charge for all the routine concerning technical analysis and trade operations.

All expert advisors can be divided into six major groups:

  • working with trend;
  • working with flat;
  • used in news trade;
  • scalping systems;
  • strategies for night trade;
  • session systems.

When you finally decide, what kind of advisor you will use, it only remains to set plan of actions.

You should determine principles pf your automated trading system. For this purpose, answer the following questions.

  • What time suits your trading the best?
  • What currency pairs and time frames your advisor is purposed for?
  • When will you trade (under trend or flat)?
  • To trade on news or to wait till market gets stable?

But there is one important rule: always watch your advisor, as it is a program and like any program, it may not work properly.

Pay attention to vendors. It’s important that the developers of ea have a successful trading experience. Of course, it's possible to download an advisor from the Internet, but in this case it should be tested and only then it can be used in your automated trading system.

After buying or downloading advisor, install it on your computer and then set it up. Also don't forget to update it in time.

"MetaEditor" embedded in MT 4 terminal is used to build the advisor. Once designed, they are saved in folder "Experts" as files with MQ4 extension (source code) and EX4 extension (executable code). List of the EX4 files can be found in the "Navigator – Expert Advisors" window.

Now we'll talk about EA trading management

To create new advisor (expert), download "MetaEditor", open "Expert Advisor Wizard" window and specify "Expert Advisor Program" as the created object. Then activate the advisor editor (you can do it by the "Navigator – Expert Advisors – Modify" command, "Tools – MetaQuotes Language Editor" option or by pushing F4 or Insert key).

Once you finish with the above, specify parameters of your EA:

  • Name — Name of advisor;
  • Author — Author of advisor;
  • Link — URL of its author’s website;
  • Parameters — list of input parameters. To add a new parameter, press "Add" key, to delete an unnecessary parameter, press "Delete".

To remove an unnecessary parameter, press "Delete". Then wizard finishes its work and directs control of advisor to its editor. Since this moment, you can directly create advisor. If you need to change current advisor, apply the "Navigator – Expert Advisors – Modify" command of the advisor. When all changes are finished, recompile your advisor.

To attach the advisor to a chart , use "Attach to a Chart" command or double-click the left mouse button on the chosen advisor in the "Navigator" window. "Drag’n’Drop" also can attach advisors. Smile icon in the top right corner of the chart means you confirmed it right. To change settings of the attached advisor, double-click the left mouse button on the smile icon, use "Expert Advisor – Properties" command or press F7 key.

When you attach either edit EA's parameters, the following settings are available for you:

  • Positions — permitted direction of opening the position:
    • Long&Short — both sides;
    • Only Long — only to buy (buy);
    • Only Short — only to sell (sell).
  • Enable alerts —permit/forbid event alerts;
  • Disable alert once hit — forbid alerts about event, once the first signal is received;
  • Allow Live trading — permit advisor to trade in a real-time mode;
  • Ask manual confirmation — ask the confirmation, when there is a new signal;
  • Allow DLL import — permit/forbid import from DLL files;
  • Confirm DLL functions` call — ask confirmation when functions are imported from DLL files;
  • Allow external experts imports — permit/ forbid calling functions from external experts.

In the "Input Parameters" tab you can change advisor's parameters. To delete attached advisor, use "Experts Advisors –Remove" command or apply another advisor. "Tools – Options – Expert Advisors – Enable Experts Advisors" option, the "charts" button and "Ctrl+E" key accelerators allow to forbid (permit) application of all advisors attached to charts. Please note that attached advisors are not removed. A special instrument was created to check operability of advisors. It is a multifunctional "Strategy Tester" window.

MT4 Custom indicators

Custom indicator is the program designed in MetaQuotes language 4 and implementing the function of technical indicator. "MetaEditor" is used to design custom indicator. You can find the list of customer indicators in the MT4 "Navigator – Custom Indicators" window.

It is rather simple to create a new custom indicator; you need only to start "Expert Advisor Wizard" program and to choose "Custom Indicators" as a program type.

Then the wizard will determine common parameters of custom indicator:

  • Name — name of the indicator;
  • Author —information about an author/designer;
  • Link — author's website;
  • Parameters — list of input parameters. To add a new parameter, press "Add" key, to delete an unnecessary parameter, press "Delete".

After this you need to determine if a new indicator will be created in a new window, set borders of values (if required) and the number of indicator massives. The values are used to display lines on the chart. In other words, when you determine indicator massives, lines of the future indicator are determined as well.

Once all parameters are set, wizard closes and gives the way to the "MetaEditor". Change of customer indicator is made the same way as in case with EA. Indicators can be deleted from the "Navigator – Custom Indicators" window by pressing the "delete".


Scripts is a program written in MQL 4 language and purposed for one-time action. Unlike EA, script is applied only once (on demand).

"MetaEditor" is also used to design scripts. The list of available scripts can be found in the "Navigator – Scripts" window. Apart from that point, script management doesn't differ from management with custom indicator or advisor

Please note:

If icons of programs in the "Navigator" window are grey, they can't be used. To work with data, you need to compile them in the MetaEditor. Client terminal consists of several advisors, custom indicators and scripts, which demonstrate opportunities of the MQL 4. Such programs can be used only for training purposes.

Once you've edited EA (custom indicator or script), you need to proceed to the compilation. Otherwise, you won’t be able to work with the changed program.

Now you know how to automate your trade.


Finally, we've finished our basic Forex market trade course. We hope, it was fascinating for you. Now you are well informed about the fundamentals and can move further. Our company will do its best to provide you with a comfortable way to reach your goals. We wish you successful trading. We have no doubt that it will be profitable, because you already have acquired knowledge and it means that you've got a key to success.

Open account with a reliable Forex broker to test your knowledge.

Back_to_chapter Move_to_chapter

您浏览器禁用cookie 文件. 在此情况下, 私人空间显示不正常. 如何启动cookie 文件的支持.