Self-learning the MQL5 language from scratch - page 3

 
MrBrooklin:

While there are no new messages from forum members, I'm studying Dmitry Fedoseyev's article https://www.mql5.com/ru/articles/2744

At first the article was clear and understandable, until I got to the section Viewing all global variables, where the code for the script is spelled out. Everything seems to be clear, but in the code:

it's not clear what it means:

int is an integer data type that has a size of 4 bytes (32 bits). The minimum value is -2,147,483,648, the maximum value is 2,147,483,647. This is clear.

But next it says i=0;i<total;i++ What does i mean? Is it a variable or something? Could any other variable be written instead of i or not? And why did this line appear at all?

The same " = ". What is it, what is it for? I could not find it in MQL5 Reference. It seems to be a trifle, but without it, I, as a beginner, cannot understand the code in general.

Sincerely, Vladimir.

Maybe, you haven't studied all operators. The loop starts with zero and continues until the condition of expression 2 is true, in increments of 1. You should study the math. It is like the difference between a resistor and an arduink or a processor.

Textbook

Generally speaking, it is a usual product development, all the stages. Goal, problem statement, logic of problem solving, here it is called algorithm, then coding.

 
MrBrooklin:

Correct me if I have misunderstood the meaning of this code:

the variable i, which has an integer data type, is assigned a value equal to zero, a value less than total and a value greater by one. Is it correct?

Sincerely, Vladimir.

You really should begin with the basics of C or C++. And not from the articles of this forum.


 
MrBrooklin:

In other words, this line specifies an enumeration of the values of all the variables? Is this true?

Regards, Vladimir.

I don't know myself, sorry)

 
Renat Akhtyamov:

You are just confused because the information is overwhelming.

Set yourself a task, for example to open a transaction programmatically

Look through the code base, compare any small code with documentation, and you will get it all!

Hello, Renat! At first I tried to start self-study using this method, but I realized that I hadn't understood anything at all! The only thing I managed to do in a couple of months was to cut a couple of EAs from parameters I didn't need and one EA was assembled from various blocks of program code. That's why I decided to start from the basics. However, thank you for the tip anyway!

Regards, Vladimir.

 
Valeriy Yastremskiy:

Apparently you haven't studied all the operators. This has something to do with the for loop. The loop starts at zero and continues until the condition of expression 2 is true, in increments of 1. You need to study the math. It is like the difference between a resistor and an arduink or a processor.

Textbook

Generally speaking, it is a usual product development, all the stages. The purpose, the problem statement, the logic of the problem solution, here it is called an algorithm, then the coding.

Valery, you are right, I haven't studied all the operators, I just read about them. I already realize that just reading the reference book is useless for me, without fixation in the code. Thank you for the tutorial. The only question is, if it is in MQL4 I won't get lost in the codes at all?

Yours sincerely, Vladimir.

 
MrBrooklin:

Hello, Renat! At first I tried to start self-study in this way, but I realized that I understood nothing at all! The only thing I managed to do in a couple of months was to cut a couple of EAs from parameters I did not need, and I managed to build one EA from various blocks of the program code. That's why I decided to start from the basics. However, thank you for the tip anyway!

Sincerely, Vladimir.

I started that way, but then I found a textbook, and then some articles. Well, one doesn't prevent the other from doing it. It's just that the language syntax is rather large, and you can't learn it fast enough. Procedural part, if operators, loops and others, mathematical part, drawing, trading part, OOP and all these are different parts of the language, which make up the element base. It is possible not to know and program something, but you just can't do it without the procedural part.

 
Roman:

You really need to start with the basics of C or C++. Not from articles of this forum.

Roman, thank you for the video! I feel, that tonight will be a sleepless night, I need to learn much.

Sincerely, Vladimir.

 
MrBrooklin:

Hello, Renat! At first I tried to start self-study in this way, but I realized that I understood nothing at all! The only thing I managed to do in a couple of months was to cut a couple of EAs from parameters I did not need, and I managed to build one EA from various blocks of the program code. That's why I decided to start with the basics. However, thank you for the tip anyway!

Regards, Vladimir.

good result

Some people never get anywhere
 
MrBrooklin:

Roman for the video thank you! I have a feeling it's going to be a sleepless night tonight, there's a lot to learn.

Regards Vladimir.

Go to this guy's channel and start watching from the beginning.
There are many lessons there. Mql is a C-like language, so the lessons will give you a basic understanding.

 
MrBrooklin:

Valery, you are right in that you haven't studied all the operators, but just read about them. I already understand that just reading the reference book, without fixing it in the code, is so far useless for me. Thank you for the tutorial. The only question is, if it is in MQL4 I won't get lost in the codes at all?

Sincerely, Vladimir.

Almost everything from 5 has been added to 4 in 2016. The only difference is in trading operations and bar numbering reversed. And the procedural part is the same. For example, the textbook doesn't contain the ternary operator if, but the if operator is well explained, as well as loops, arrays and indicator logic. And this is the same.

Reason: