Discussing the article: "From Basic to Intermediate: Indicator (II)"

 

Check out the new article: From Basic to Intermediate: Indicator (II).

In this article, we will examine how to implement a moving average calculation and what precautions should be taken when performing this calculation. We will also discuss overloading the OnCalculate function to know when and how to work with one model or another.

In the previous article " From Beginner to Intermediate: Indicator (I)", we began a practical discussion on how to create a very simple and lightweight indicator using minimal knowledge. While many might think that achieving results requires extensive coding knowledge, it turns out that even a beginner, with some effort, can create something relatively simple and functional. Moreover, in a rather elegant way, since most of the work is handled by MetaTrader 5. It is up to us to respond correctly to events. Then MetaTrader 5 will know what to do with the remaining information we process during these events.

You might think, «But that code we managed to create doesn't resemble any indicator I've ever seen before. And although we succeed in plotting something on the chart, it's not quite what I expected—I hoped I could do much more».

Alright, my dear reader, you might think all of this doesn't look very impressive, but you must remember that knowledge isn't acquired overnight: it needs to be cultivated. The goal of this series of articles is precisely that: to cultivate and spread knowledge. It's not about following the principle, "Do this because it will only work this way." So, let's see how far we've come in the previous article.



Author: CODE X

 

Hi!


Loved the article!


I think it would be more enjoyable using more images to describe what are you doing trough each step.

 
Osmar Sandoval Espinosa # :

Oi!


Adorei o artigo!


Acho que seria mais interessante usar mais imagens para descrever o que você está fazendo em cada etapa.

Regarding this, the tip is: You may notice that at certain points we pause the code shown, usually when an image is displayed. This is so we can change things later. So instead of using the pre-made code in the attachment, my advice is: Open the article and type the code as it's shown, testing what happens as you build it. This way, you'll be able to better follow what's happening and even understand why that path was taken and not another, which may not have been shown in an image. This allows you to test hypotheses and learn much more about how to actually build things according to a specific goal.