Читать книгу Expert advisor for MT4 for one evening - Evgeny Zhdan - Страница 6

DESIGN SPECIFICATION

Оглавление

Let’s describe what our future adviser should do and when:


The trading signals will be generated by two standard indicators – the Envelopes and ZigZag. These indicators are built into MetaTrader4 and you do not need to download them separately. I chose these two indicators because their values are being requested in different ways. In case of Envelopes – by using the standard iEnvelopes function, and in case of ZigZag – by the iCustom function – you need to research it yourself (it sounds dramatic, I know) so that sometime later you’ll be able to request the data of almost any non-standard indicators of MetaTrader4.


Let’s make a brief design specification:

– If the upper peak of the ZigZag indicator (hereinafter – ZZ) is generated above the upper line of the Envelopes indicator (with the parameter Shift = 10, with the standard others), we should make a sell order with a fixed lot set in the Advisor’s settings.

– If the lower ZZ peak is generated below the lower Envelopes one – a buy order (i.e., vice versa compared to the buy signal).

– By modification (we’ll examine later while writing the code, why we should do it this way and not immediately by installing the order), the adviser should be able to set Stop-Losses and Take-Profits over the orders.

– to add the option of closing the orders when the price reaches the opposite line of Envelopes. This function can be turned off in the settings.

If you are reading this book, I hope that you already have a MetaTrader4 trading terminal on your computer and you know how to set a demo account. If not, you need to install this terminal by pre-registering with any broker supporting MetaTrader4.

And now, translate your terminal into English! If you set your sights on pursuing programming, get used to English, no way round it! Leave the MetaEditor code editor in Russian, because when you translate it into English, its Help (F1) would also be in English. It’s not everyone’s cup of tea.

Expert advisor for MT4 for one evening

Подняться наверх