Download MetaTrader 5

Discussion of article "Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator"

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
189344
MetaQuotes Software Corp.  

New article Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator is published:

MetaQuotes Programming Language 5 (MQL5), included in MetaTrader 5 Client Terminal, has many new possibilities and higher performance, compared to MQL4. This article will help you to get acquainted with this new programming language. The simple examples of how to write an Expert Advisor and Custom Indicator are presented in this article. We will also consider some details of MQL5 language, that are necessary to understand these examples.

Author: Denis

Denis Zyatkevich
7808
Denis Zyatkevich  

After downloading the file "indicator_TP_en.mql5", rename it to "indicator_TP.mql5", please.

 

mollixas
3
mollixas  

This ExpertAdvisor does not work on MT5 build 712, at least not for me.

There is an error message "Cant't copy indicator buffer".

Also the indicator does not compile without warnings,

"possible loss of data due to type conversion" on line 53,

"possible use on uninitialized varaiable 'day_n'"  on line 54

"possible use on uninitialized varaiable 'h_day'"  on line 62

"psosible use on uninitialized varaiable 'l_day'"  on line 63


Can you correct these problems, please?

This is otherwise a good example for us who have background in other software but MT5.

XIn Li
335
XIn Li  
If I want to place 5 sell stop and 5 buy stop pending orders and gap between them 10 pips. How do I so that?
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
Alain Verleyen
Moderator
33612
Alain Verleyen  

This is a excellent article, for beginners and people who comes from mql4, with in prime a good trading strategy example.

There are some minor lacks in code (error checking not always implemented), but the EA works very well if used on minute timeframe as recommended by the author. Warnings when compiling the indicator are only warnings, and are not blocking you to use it and the EA.

Thank you.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Chart Timeframes
  • www.mql5.com
Standard Constants, Enumerations and Structures / Chart Constants / Chart Timeframes - Documentation on MQL5
Grzegorz Korycki
61187
Grzegorz Korycki  

this is not an easy way of explaining mql5 to the people. (like beginners ever had chance to understand it!) its like with programming books 90% of people dont have idea how to start. They open this book for example about c programming and first "Easy example" is long for 1 whole page written in tiny fonts. In my whole life i read only one good programming book that could teach programming to anyone. The reason for that is that they are being written by probably excellent programmers, but unfortunately very bad teachers. Programming can be really easy and i will prove it to you making a simple tutorial for MQL4 programming language when i have a little more time than now. For everyone - even total beginners. The biggest mistake is to teach people details of language most of their work should be ctrl+C and ctrl+v and use google for the commands and most important - keeping everything VERY SIMPLE. I know 10+ programming languages (I programm since i was 7) and i am still am scared by the way this "Easy example" on 11kb (!!!) is explained. I would like to know is there is any real programming beginner that learned MQL5 from this example ;D. I doubt it and if there is you can count these people on fingers of one hand.

Fast Dive into MQL5
  • 2012.08.02
  • MetaQuotes Software Corp.
  • www.mql5.com
You have decided to study MQL5 trading strategies' programming language, but you know nothing about it? We have tried to examine MQL5 and MetaTrader 5 terminal from the newcomers' point of view and have written this short introductory article. In this article, you can find a brief idea of the possibilities of the language, as well as some tips on working with MetaEditor 5 and the terminal.
Alain Verleyen
Moderator
33612
Alain Verleyen  
angreeee:

this is not an easy way of explaining mql5 to the people. (like beginners ever had chance to understand it!) its like with programming books 90% of people dont have idea how to start. They open this book for example about c programming and first "Easy example" is long for 1 whole page written in tiny fonts. In my whole life i read only one good programming book that could teach programming to anyone. The reason for that is that they are being written by probably excellent programmers, but unfortunately very bad teachers. Programming can be really easy and i will prove it to you making a simple tutorial for MQL4 programming language when i have a little more time than now. For everyone - even total beginners. The biggest mistake is to teach people details of language most of their work should be ctrl+C and ctrl+v and use google for the commands and most important - keeping everything VERY SIMPLE. I know 10+ programming languages (I programm since i was 7) and i am still am scared by the way this "Easy example" on 11kb (!!!) is explained. I would like to know is there is any real programming beginner that learned MQL5 from this example ;D. I doubt it and if there is you can count these people on fingers of one hand.

You are right about programmers not being good teachers in general.

But I don't agree when you said mql5 is so difficult to learn, mainly for a programmer who have experimented with 10+ languages. 

Muhammad Syamil Bin Abdullah
1161
Muhammad Syamil Bin Abdullah  
Indeed this is great article for beginners of mql5 programming, like me. angevoyageur speak right about it.
Ibrahim Melssen
49
Ibrahim Melssen  
I have copy paste the Expert Advisor and try to test it with Strategytester. But it doesn't make any trades. I am new to MQL5 and programming so maybe I just made a stupid mistake. It compiled without any errors. I'd really like the strategy! Anyone ideas why it doesn't run on strategytester..?
To add comments, please log in or register