Русский 中文 Español Deutsch 日本語 Português
preview
MQL5 — You too can become a master of this language

MQL5 — You too can become a master of this language

MetaTrader 5Interviews | 7 July 2023, 09:24
5 460 4
Daniel Jose
Daniel Jose

Introduction

In this article, I am going to do something different from what I've been doing in earlier articles. Basically, this material is intended for those who have little or no knowledge of MQL5 or programming in general. So, the article will be like an interview with myself. in which I will explain a little bit how to learn MQL5 from scratch and to become a professional.


A little of story

Since I started writing articles for the MQL5 community, I have received a lot of feedback. Many people contact me, asking how I learned to program in MQL5 so that I can do the things that I describe in the articles. Most of these people are enthusiasts looking for a basic guide to take their first steps in programming. So, this article is dedicated to all of you, enthusiasts and novice MQL5 programmers willing to learn MQL5 programming.

Before proceeding with this topic, I need to say something. The purpose of this material is not to demotivate you but, on the contrary, to increase your motivation even more.

You might think that I must have many years of MQL5 programming experience. However, by the time of writing this article, I have been using the MQL5 language for only a year and a half. That's right, I have less than two years of experience as an MQL5 programmer. You might probably be wondering how someone with so little MQL5 programming experience could manage to do the things for MetaTrader 5 that were shown in the articles.

This is because the developers of the MQL5 programming language had a great idea of making the language look like C/C++ in many aspects. So, if a programmer has extensive C/C++ experience, it will be quite easy to learn MQL5, since there is no need to relearn all concepts, syntax and commands.

Why am I saying this? Because I have been a professional C/C++ programmer since the early 2000s, that is, I have been programming in C/C++ for over 23 years. If I had to learn a new language in order to do something for MetaTrader 5, most likely I would finally give up.

Many people think that to be a good programmer, you need to take some courses. However, to really learn to program, you shouldn't be afraid of making mistakes. You should never get attached to a code or idea. You should always look to experiment and try new things.

This may sound a little strange, since many new people always like to do the same thing and in the same way. But a person who wishes to become a great programmer is always looking for different ways to do the same thing. Also, many people do not understand that a programmer will always be inspired by others. They can take working source code developed by a more experienced programmer and change it little by little, experimenting and watching the result. This way they learn how the program is actually built.

Some people think that to learn MQL5 you have to start studying something. In fact, if anyone who doesn't have any prior knowledge asks me how to learn, I always recommend starting with the simplest. In other words, learn a little about C to really know the syntax and programming logic, as well as the commands. Once you understand the basics of the C language, start studying C++ and at the same time start practicing MQL5. The simple fact that you already have basic C knowledge will greatly help you start programming in MQL5.

Some people may think that C is obsolete, but the truth is that C is an extremely well documented and widely used language. You can find a lot of materials to learn how to use C. Please note that I'm not saying that you should delve into C. Quite the contrary, if you learn some basic commands, syntax and commands, that will be enough for you to get started with MQL5.

This may seem a little discouraging: learn C to develop advance in MQL5? Perhaps, if you put in a lot of effort and find someone willing to teach you, you can start directly with MQL5. But from my first experience and the opinions of other people, I can say that the task will not be so easy. Almost all quality material is concentrated here, in the MQL5 community. In the rest of the internet, the material is scattered and can be of poor quality, which will do more harm than good. When it comes to the C and C++ languages, there is a huge amount of excellent and very accessible material. So, it's up to you to choose where to start.


My first code in MQL5

Many people think that since I already know how to program in C/C++, I immediately started with complicated and elaborate projects in MQL5. I wish I could say that this is how it all started. However, the reality turned out to be quite different.

Whenever we take the first steps in developing our own solutions, we often start with what we think we already know. In my case, when I started to use MQL5, all I had at hand was the language documentation. I didn't even know there was a community dedicated to helping other interested programmers.

So, studying the documentation and examining source codes that come with MetaEditor, I started experimenting. Below is my first real code which I created based on what I understood.

01. //+------------------------------------------------------------------+
02. #property copyright "Daniel Jose"
03. #property version   "1.00"
04. #property description "Modify special chart properties"
05. #property script_show_inputs
06. //+------------------------------------------------------------------+
07. enum eWhat  {
08.                eScaleDate  = CHART_SHOW_DATE_SCALE,   //Time scale
09.                eScalePrice = CHART_SHOW_PRICE_SCALE   //Price scale
10.             };
11. enum eOp    {
12.                eFalse,                                //Makes hidden
13.                eTrue                                  //Makes visible
14.             };
15. //+------------------------------------------------------------------+
16. input eWhat user00 = eScaleDate;                      //Graphic property
17. input eOp   user01 = eFalse;                          //What to do?
18. //+------------------------------------------------------------------+
19. void OnStart()
20. {
21.    ChartSetInteger(0, (ENUM_CHART_PROPERTY_INTEGER) user00, user01);
22. }
23. //+------------------------------------------------------------------+

Source code of my first MQL5 program

There is nothing extraordinary or innovative. This is primarily code, the purpose of which was to verify if I correctly understood the documentation and how elements could be defined and used. The following video shows the code execution result.


Demo video

This is something extremely basic. But being able to create this code in a completely autonomous way, without anyone's help, except for documentation and source codes from MetaEditor, showed me that I can do something else. All I had to do was to adapt my existing knowledge of C and C++ to MQL5. This is where things really started to progress.

Maybe, looking at this simple code above, you don't find anything valuable in it. But as usual, the first task of any beginner in a programming language is to create code known as "HELLO WORLD", where the idea is to display a message on the screen.

But I'm way past the phase of the "HELLO WORLD" code. So, I went to try something a little more complicated. However, because I didn't have that much experience and understanding of how MQL5 actually worked, I started by developing a script. It was something much easier for me, given the little experience and knowledge of how things actually happened.

Only after some time I started to realize that MQL5 is not actually a procedural language, but an event-based one. This discovery radically changed my approach to programming and code analysis. Wanting to improve my skills, I started studying and reading articles here in the MQL5 community, and I realized that although many could get their code to work, they were learning MQL5 in a relatively basic way, at least in my opinion. Therefore, I began to develop and experiment with more complex solutions that would explore the capabilities of the MetaTrader 5 platform and the MQL5 language in more depth.

And at some point I decided to start sharing the results of my experiments. This is how my first article appeared. It is one thing to build code and there is another thing to explain how it is built and designed. I knew that both experienced and beginners would read these articles.

The articles have undergone changes both in form and content. I did this so that even those with little experience could understand the information. And even if you cannot immediately absorb all the knowledge presented in the material, over time, as you improve your programming skills, you will be able to correctly assimilate what I am trying to convey in a particular article.

Knowledge needs to be shared. I see no glory in dying with all your wisdom without leaving behind something valuable, something that could change someone's worldview, awaken to something that many do not realize, because they always keep their heads down.

But let's get back to the code. I want to show you that even a few lines of code can contain much more information and knowledge than a thousand lines of code. Although originally, all the information, which is not part of the C/C++ syntax, and therefore MQL5, was not in English. But this is just a mere detail. Let's see this little code and understand how it works. And mainly: Why it works.


Analyzing the code

Lines two, three and four could be dropped from the code. In fact, they serve MetaTrader 5 only to inform the user about the purpose of the code. Being the user, you can simply remove these lines from your learning code.

Line five is very important because without it, MetaTrader 5 will not understand that the script can be customized by the user through some kind of input structure, which in this case is 'inputs' shown on lines 16 and 17. We'll get there soon.

Now comes something that many may not understand. Especially, if they only studied MQL5 or if they are coming from some other language very different from C/C++. I am talking about the enumerations, which are present in lines 07 and 11.

Most likely you can be confused when looking at such constructions. You may even imagine that they are something too complicated for you. But precisely because MQL5 was built to bring in C/C++ programmers, that makes it so pleasant to be used by those who already have even a small experience in C/C ++. But let's understand the enumerations, at least superficially.

An enumeration can be roughly understood as a sequence of data where you can assign value to them or not. When you don't assign a value, the count will always start with the first possible value which in this case is zero. Therefore, the enumeration defined in line 11 follows the same principle as the value 0 or 1. In C / C++, as in MQL5, the zero value is considered false, and the value of one is considered true.

Therefore, line 12, where the eFalse value is defined, we have the indication of zero, and in line 13, which is the second value of the enumeration, we will have the value of one. If we had more things defined, they would follow the sequence, so the next would be two, three, and so on. This is the simplest case.

I want to draw your attention to something else. At the end of line 12 we have something that would be a comment in C/C++. We also have the same type of things in other lines. Let's focus on line 12, but this will also apply to all other places.

If we look at the script when it is launched on the chart, we will see Figure 01. In it, I highlight what exactly matches the comment on line 12.

Figure 01

Figure 01 - User interaction window


Such things greatly simplify MQL5 coding. In other languages, we would have to do a few things to get what is done here in MQL5 in such a simple and practical way. Therefore, you need to understand that writing a comment to the code is the right thing to do, because it allows you not only to make the code more understandable, but also to customize the message that will be displayed to the user.

Let's now take a step back to line 07 where we have another enumeration. However, this enumeration is different from the one I just explained. These are not entirely different things: the difference is that now we assign values to each of the elements. That is, the compiler will use the values we specified, which in this case are constants defined in MQL5. You might ask: Why not use constants directly instead of assigning them to an enumeration? The reason is the ease of implementation. If we were to use constants directly, we would have to create something else, such as an array or a structure, and this is much more difficult. Using my approach, you can insert any value in any position or sequence. And if some constant of interest appears in the sequence I declare, I don't really need to assign or declare that constant; all I have to do is add more content to the enumeration, and the language will take care of ensuring that the correct values are used and assigned appropriately.

See how having a solid, well-built foundation in a language like C/C++ helps us when writing MQL5 code. What we show here is not often found in MQL5 code. In fact, I have noticed that many resort to much more complex and time-consuming constructions in order to achieve the same that they got here. And note that I ended up writing just one line of code (line 21).

Now pay attention to the following: in line 21 itself, which is actually the only one that will be executed, we need to do an explicit type conversion. This is necessary for the compiler to understand it and, accordingly, correctly generate the final code. But why is explicit conversion so important? The reason is in the compiler. It doesn't really matter to the processor, because we're only using numbers, and that's what the processor actually sees. Types are not of interest to the processor, it just observes numbers. But the second argument of line 21, despite being a numerical value, is not exactly what is expected by the ChartSetInteger function. This function expects a certain type, not a numerical value. Even if the value represents the expected type, i.e. the value is exactly the constant we are using, the compiler will see this as an error. So, to fix this, we explicitly force the numerical value to be converted to a type expected by the ChartSetInteger function. Thus, the compiler will be able to understand that we are aware of the values we are passing to the function.


A few thoughts on Python

Before closing our conversation, dear reader and novice programmer, I want to share some final thoughts, the results of my experience and knowledge gained over several years of working with various programming languages. Ny purpose is to prevent any future frustrations that may arise when trying to perform certain actions in MetaTrader 5.

Although our main topic is MQL5, the following question is often asked: whether or not to study Python. Especially for those who are starting to learn programming to trade in the financial markets, the question arises whether it is worth deepening their knowledge of Python to work with MetaTrader 5. This question is very relevant, since learning Python is much easier and faster than going through the difficulties of learning C, then C++, and finally getting a solid and consolidated foundation for professional work with MQL5. However, there is one point to keep in mind so that you do not think that you have wasted your time learning (or not learning) Python.

The Python programming language (although some prefer to refer to it as a scripting language) is not comparable to what can be done in MQL5 - perhaps that is why some do not consider it a programming language, but we will not enter into this debate here. If your goal is to learn and be able to generate codes just to test, verify and analyze something in a pure mathematical way, then the shortest and easiest solution is to learn Python. This is because you it is easier to run backtests and the like in Python, interacting directly with MetaTrader 5, than trying to do the same thing using MQL5.

It may seem strange to some, but with a little training and a lot of dedication, you can easily create a Python script that can do the same thing that a programmer with much more experience can do with MQL5. Many times, the programmer would have to create indicators, Expert Advisors, in addition to having to configure the strategy tester, to verify whether a given operating system, the so called SETUP, is profitable or not. Not to mention the risk of putting everything at risk by not setting everything up properly.

One might think that when using MetaTrader 5, we have access to charts and a beautiful presentation of results, which will make it easier for us to analyze. However, consider how much knowledge you will need to program all the functions needed to perform a simple backtest directly in MetaTrader 5.

Working with Python, you can use the package to access MetaTrader 5 data. Using everything that can be done in Python, it is easier to carry out the same research that an MQL5 programmer does. Once the research is completed, you can alternatively export the data to Excel or another program to do all the graphical representation that can be done in MetaTrader 5, making it easier to analyze the results.

I need to add some brief explanation here. Why use Python instead of Excel correctly since the results would be plotted in Excel? The reason is simple: VBA (Visual Basic for Application) does not give us direct access to the same data that we would have through Python, given the use of MetaTrader 5 data. To do this in Excel, you should either create a DLL to support such things or export lots of files in CVS format in order to get the same data.

Once inside Excel, you will have perhaps even more work to produce all the calculations that would be done in Python. On the downside, if you decide to change the database, you'll have to do all the work again in Excel. But if you're using Python, all you need to do is instruct Python to change the database, and it will provide this directly to MetaTrader 5 without any extra effort on your part.

So, my advice is to try to learn as much as you can, because each tool has its advantages and disadvantages. Although Python is very useful, it does not allow you to create an indicator to be displayed on a chart or an Expert Advisor to help you trade. This can only be implemented through MQL5. Therefore, there is no better or worse tool here. They complement each other and serve different purposes. In any case, study both things, because you never know when you will need to use one or the other.


Conclusion

Despite all the simplicity involved here, you must always remember the following: You are just starting out. Don't try to do something complicated right away. Try to create something that works. Even though it may seem completely useless at first glance, start with something simple.

Start experimenting with the functions little by little. Study the C/C++ language to expand your MQL5 programming capabilities. Always practice and try to do things in your own way, differently from what many always do, because no matter how complicated a task may seem, there is always the way to do it better.

Learn to simplify your codes, be patient and persistent. Don't give up if you find a problem that's a little beyond your knowledge. In such a situation, learn even more and try to create a solution based on what you already know. If you have already solved a problem, look for a better solution for it. Your ultimate reward will be vast and deep knowledge, a wealth that no one can take away from you. Knowledge can be borrowed but it can never be stolen.

Be humble and try to share your knowledge with others. By doing so, you learn new things and also show new possibilities for those who are focused another solutions. That's all for today.


Translated from Portuguese by MetaQuotes Ltd.
Original article: https://www.mql5.com/pt/articles/12071

Last comments | Go to discussion (4)
Hely Rojas
Hely Rojas | 7 Jul 2023 at 17:31
I'm just going to give my humble opinion.
Metatrader is a Forex application. Not a program to interact with WebGL or DirectX. If you want to make a window application I look up Visual C++, Visual Studio. If I want an animation application I look for Unity.
I prefer the simplicity of MQL4. So easy it was to load an indicator in "Old" MQL4. I never really missed those M2 M3 (m3, seriously) time frames.
What MQL5 is really good at is access to historical data for optimization.
BTrader22
BTrader22 | 9 Jul 2023 at 08:56
Great article. Thanks...
Eric A. Kantchev
Eric A. Kantchev | 16 Jul 2023 at 21:04

I am going myself through the journey right now, so below I give some brief notes on the topic of the article from the point of view of a trader who wants to trade the financial markets with Metatrader using own algos. Keep in mind trader's primary goal is trading, while software engineer's is programming.

1. The biggest obstacle will be wading through the mud of irrelevance that nowadays has made internet learning into a real swamp. Finding good sources will consume more time and effort than learning from the right ones once you find them. 

2. There is no good low cost source to learn MQL, to the best of my knowledge.  Udemy courses are not all that great (speaking from experience), only worth buying when they are deeply discounted (10 euros or below). Youtube videos: there are some channels that are pretty good - if you are looking for specific things. A few give you just the very basics. None post a systematic course that teaches you all you need to know, not for free. Most of the free good videos are usually a marketing funnel into the paid courses. Nothing wrong with that, just something you need to be aware of. I cannot comment on the paid courses, never done any.

3. In software engineering at large, MQL simply does not exist. There is a book or two, those teach the language in its entirety. They are written for programmers, not traders.  Hence, learning all that will consume many months if not years of your time even if you have the patience and the time. Time that you could be spending trading. The actual subset of knowledge that is necessary to make your own EAs and Indicators that are sophisticated enough to be trusted on your own live accounts is considerably smaller. A lot of things are simply not necessary for own use codes. If you want to freelance or sell prepackaged MQL codes, you need to master a bigger deal of the laguage, of course.  A side note: even if you are a trader, it might be worth spending time and effort to learn general software engineering (in one of the big laguages like C++ or C#, but not MQL) on the side. If you blow your account, making money as a coder may allow you to avoid starvation and slowly build capital to go in the game again. 

4. MQL Reference set of pages on this website is a reference not a text book. It is invaluable to know the inside and out of specific MQL language elements. It is a nightmare to study from (I know, I tried).

5. The best in my opinion is to learn the basics with C++. There are many excellent courses on C++ for very low cost or free.  C# or Java (NOT JavaScript, JS is like Python but worse!) are also suitable, even if a bit more remote. Also, in my opinion it is not beneficial to learn C. In 2023, C is a niche langauge for systems programming (OS, drivers, etc). C++ incorporates all of the classic C you need. 

6. MQL core functionality is practically C++. To the basic language, a whole bunch of enumerations, built-in functions and classes that are specific for trading on MT platform is added. Those trade-specific elements do not exist in C++, of course. Once you know how variables, constants, data types, functions and objects behave in general in C++, it is very easy to get those additional specific MQL elements. You need to learn OOP enough to know what it is, what it does, and how to use objects from the  built-in  MT library classes in your procedural codes alongside functions. Using available classes is much easier than programming your own classes, creating libraries, manage tens or hundreds of header (.mqh) files, etc. Programming your own OOP is like building a multinational car manufacturer company just to build a single car, so you can drive from home to work everyday.

7. Forget Python. I can write pages about it, but just take my word for it. Python simplifies some things, creates complications in others. Python's real problem is that it has too much freedom. The rigid syntax of C++, the static types and above all Sergeant Compilator in the end result in codes that are very unambiguous and reliable. The freedom of Python is often the freedom to go in the water and drown yourself. The 'difficulties' of learning C++ are more of a myth than reality. Consider this:  C++'s {} and ; are replaced in Python by : and mandatory indentation, in the end the effort ends up about the same.  You do not need to learn the whole of C++ to master MQL5 anyway. I learned Python all the way to OOP, then realized after 16 months I was still at the 0 point of my journey as an algo programmer, then relearned C++ (I forgot about 99% of the C++ course I took as a STEM undergraduate student almost 30 years ago). Thereafter I was able to write usable MQL5 EAs and indicators. 

6. In many ways MQL5 is closer to C++ than MQL4. That results in many things being more difficult in MQL5 than MQL4. Still, in 2023, it is not recommended for people who are nnow starting out to learn MQL4. MQL4 is kept alive by its installed user base from the times when it was current. Even if both languages were equal, MT5 comes with a superior backtester and the ability to download a standalone MT platform with never expiring, non-broker-affiliated demo account to play at your heart's content. If you need, it is easy to translate your MQL5 EAs backwards to MQL4 once you master MQL5. Indicators take a bit more effort, still quite doable.

7. So here is the learning path that worked for me:

- Learn programming basics with a general programming language, easiest with C++ because it is the closest to MQL. All programming cources teach the basics with simple console programs. MetaEditor does not have a console. Printing "Helllo World!" in the Terminal Journal is far inferieor experience than directly on a console with "cout >>". You can interact with an MQL code only indirectly through the input parameters, not in real time through "cin >>".

- Once you have mastered the programming basics, go to youtube and find videos that go step by step on building a whole working EA or indicator (there are plenty at time of writing). First, watch the whole video, most efficiently by turning off the sound, on the subtitles and speeding up to 1.5x or 2x to grasp the content. Then, watch again and type the code along, pausing the video and rewinding if you need, with sound on.

- Don't take more programming courses - just code code code, backtect backtest backtest.  Unfortunately, MQL does not offer unit testing facility (indispensible for proper software engineering), but with some creativity you can develop your own ways to use the backtester for that. Watch more videos on specific topics when you need. Articles/posts on this website can be equally helpful. Hit F1 in MetaEditor as often as you need. Hit it even if you don't, just to learn something new or polish what you already learned eveyday. 

Daniel Jose
Daniel Jose | 17 Jul 2023 at 14:12
Eric A. Kantchev # :

Eu mesmo estou passando pela jornada agora, então abaixo eu dou algumas breves notas sobre o tópico do artigo do ponto de vista de um trader que deseja negociar nos mercados financeiros com o Metatrader usando algoritmos próprios. Tenha em mente que o objetivo principal do trader é negociar, enquanto o do engenheiro de software é programar.

1. O maior obstáculo será caminhar na lama da irrelevância que hoje em dia transforma o aprendizado pela internet em um verdadeiro pântano. Encontrar boas fontes consumirá mais tempo e esforço do que aprender com as fontes certas depois de encontrá-las.

2. Não existe uma boa fonte de baixo custo para aprender MQL, pelo que sei. Os cursos da Udemy não são tão bons (falando por experiência), só valem a pena comprar quando estão com grandes descontos (10 euros ou menos). Vídeos do Youtube: existem alguns canais que são muito bons - se você estiver procurando por coisas específicas. Alguns fornecem apenas o básico. Nenhum publica um curso sistemático que ensine tudo o que você precisa saber, não de graça. A maioria dos bons vídeos gratuitos geralmente é um funil de marketing para os cursos pagos. Nada de errado com isso, apenas algo que você precisa estar ciente. Não posso opinar sobre os cursos pagos, nunca fiz nenhum.

3. Na engenharia de software em geral, MQL simplesmente não existe. Há um livro ou dois, que ensinam o idioma em sua totalidade. Eles são escritos para programadores, não para traders.   Portanto, aprender tudo isso consumirá muitos meses, senão anos, do seu tempo, mesmo que você tenha paciência e tempo. Tempo que você poderia gastar negociando. O subconjunto real de conhecimento necessário para criar seus próprios EAs e indicadores sofisticados o suficiente para serem confiáveis em suas próprias contas ativas é consideravelmente menor. Muitas coisas simplesmente não são necessárias para códigos de uso próprio. Se você deseja trabalhar como freelancer ou vender códigos MQL pré-empacotados, é claro que precisa dominar muito a linguagem. Uma nota lateral: mesmo se você for um comerciante, pode valer a pena gastar tempo e esforço para aprender engenharia de software geral (em uma das grandes linguagens como C++ ou C#, mas não MQL) paralelamente. Se você explodir sua conta, ganhar dinheiro como programador pode permitir que você evite a fome e lentamente acumule capital para entrar no jogo novamente.  

4. O conjunto de páginas de referência MQL neste site é uma referência, não um livro de texto. É inestimável conhecer o interior e o exterior de elementos específicos da linguagem MQL. É um pesadelo estudar (eu sei, eu tentei).

5. O melhor na minha opinião é aprender o básico com C++. Existem muitos cursos excelentes em C++ por um custo muito baixo ou gratuitos.   C # ou Java (NÃO JavaScript, JS é como Python, mas pior!) Também são adequados, mesmo que um pouco mais remotos. Além disso, na minha opinião, não é benéfico aprender C. Em 2023, C é uma linguagem de nicho para programação de sistemas (SO, drivers, etc). C++ incorpora todo o C clássico que você precisa.

6. A funcionalidade principal do MQL é praticamente C++. À linguagem básica, é adicionado um monte de enumerações, funções internas e classes específicas para negociação na plataforma MT. Esses elementos específicos do comércio não existem em C++, é claro. Depois de saber como variáveis, constantes, tipos de dados, funções e objetos se comportam em geral em C++, é muito fácil obter esses elementos MQL específicos adicionais. Você precisa aprender OOP o suficiente para saber o que é, o que faz e como usar objetos das classes de biblioteca MT integradas em seus códigos processuais juntamente com as funções. Usar classes disponíveis é muito mais fácil do que programar suas próprias classes, criar bibliotecas, gerenciar dezenas ou centenas de arquivos header (.mqh), etc. pode dirigir de casa para o trabalho todos os dias.

7. Esqueça o Python. Posso escrever páginas sobre isso, mas aceite minha palavra. Python simplifica algumas coisas, cria complicações em outras. O verdadeiro problema do Python é que ele tem muita liberdade. A sintaxe rígida do C++, os tipos estáticos e, acima de tudo, o Sergeant Compilator no final resultam em códigos muito inequívocos e confiáveis. A liberdade de Python geralmente é a liberdade de entrar na água e se afogar. As 'dificuldades' de aprender C++ são mais um mito do que realidade. Considere isto: {} e ; são substituídos em Python por : e recuo obrigatório, no final o esforço acaba sendo o mesmo.   Você não precisa aprender todo o C++ para dominar o MQL5 de qualquer maneira. Aprendi Python até OOP e, depois de 16 meses, percebi que ainda estava no ponto 0 de minha jornada como programador de algo, depois reaprendi C++ (esqueci cerca de 99% do curso de C++ que fiz como aluno de graduação STEM quase 30 anos atrás). Depois disso, consegui escrever EAs e indicadores MQL5 utilizáveis.

6. De muitas maneiras, o MQL5 está mais próximo do C++ do que do MQL4. Isso resulta em muitas coisas sendo mais difíceis em MQL5 do que em MQL4. Ainda assim, em 2023, não é recomendado para pessoas que estão começando a aprender MQL4. O MQL4 é mantido vivo por sua base de usuários instalada desde os tempos em que era atual. Mesmo que ambos os idiomas sejam iguais, o MT5 vem com um backtester superior e a capacidade de baixar uma plataforma MT independente com uma conta demo nunca expirada e não afiliada ao corretor para jogar o quanto quiser. Se você precisar, é fácil traduzir seus EAs MQL5 de volta para MQL4 depois de dominar o MQL5. Os indicadores exigem um pouco mais de esforço, ainda bastante factíveis.

7. Aqui está o caminho de aprendizado que funcionou para mim:

- Aprenda o básico de programação com uma linguagem de programação geral, mais fácil com C++ porque é o mais próximo do MQL. Todos os cursos de programação ensinam o básico com programas de console simples. O MetaEditor não possui um console. Imprimindo "Olá, Mundo!" no Terminal Journal é uma experiência muito inferior do que diretamente em um console com "cout >>". Você pode interagir com um código MQL apenas indiretamente por meio dos parâmetros de entrada, não em tempo real por meio de "cin >>".

- Depois de dominar os fundamentos da programação, acesse o youtube e encontre vídeos que explicam passo a passo a construção de um EA ou indicador funcional completo (existem muitos no momento em que escrevo). Primeiro, assista ao vídeo inteiro, de forma mais eficiente desligando o som, nas legendas e acelerando para 1,5x ou 2x para apreender o conteúdo. Em seguida, assista novamente e digite o código junto, pausando o vídeo e rebobinando se precisar, com som ligado.

- Não faça mais cursos de programação - apenas codifique o código do código, backtect backtest backtest. Infelizmente, o MQL não oferece facilidade de teste de unidade (indispensável para uma engenharia de software adequada), mas com alguma criatividade você pode desenvolver suas próprias maneiras de usar o backtester para isso. Assista a mais vídeos em tópicos específicos quando você precisar. Artigos/postagens neste site podem ser igualmente úteis. Pressione F4 no MetaEditor sempre que precisar. Acerte mesmo que não, apenas para aprender algo novo ou aprimorar o que você já aprendeu todos os dias.

Thanks for the evidence. This is more or less what I wanted to write this article. Because many people who start out don't know which direction to go in and end up dropping out of studying or learning, imagining that it's something very difficult or something impractical.

Creating Graphical Panels Became Easy in MQL5 Creating Graphical Panels Became Easy in MQL5
In this article, we will provide a simple and easy guide to anyone who needs to create one of the most valuable and helpful tools in trading which is the graphical panel to simplify and ease doing tasks around trading which helps to save time and focus more on your trading process itself without any distractions.
Can Heiken-Ashi Combined With Moving Averages Provide Good Signals Together? Can Heiken-Ashi Combined With Moving Averages Provide Good Signals Together?
Combinations of strategies may offer better opportunities. We can combine indicators or patterns together, or even better, indicators with patterns, so that we get an extra confirmation factor. Moving averages help us confirm and ride the trend. They are the most known technical indicators and this is because of their simplicity and their proven track record of adding value to analyses.
Revisiting an Old Trend Trading Strategy: Two Stochastic oscillators, a MA and Fibonacci Revisiting an Old Trend Trading Strategy: Two Stochastic oscillators, a MA and Fibonacci
Old trading strategies. This article presents one of the strategies used to follow the trend in a purely technical way. The strategy is purely technical and uses a few technical indicators and tools to deliver signals and targets. The components of the strategy are as follows: A 14-period stochastic oscillator. A 5-period stochastic oscillator. A 200-period moving average. A Fibonacci projection tool (for target setting).
Improve Your Trading Charts With Interactive GUI's in MQL5 (Part II): Movable GUI (II) Improve Your Trading Charts With Interactive GUI's in MQL5 (Part II): Movable GUI (II)
Unlock the potential of dynamic data representation in your trading strategies and utilities with our in-depth guide to creating movable GUIs in MQL5. Delve into the fundamental principles of object-oriented programming and discover how to design and implement single or multiple movable GUIs on the same chart with ease and efficiency.