You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I continue studying the MQL5 programming language and am posting the code of a script, which is a continuation of one task from the participants of this thread. The script has been tested in all modes. No problems detected. I have set the minimum number of input parameters to start with. The script code is written in English, the comments to the code are in Russian, to facilitate the learning. As I promised earlier, I tried to describe the script in a manner accessible to a 1st class student of the programming school.
Regards, Vladimir.
ok
now make the code of the algorithmic logic more readable
it turns out in only two lines:
if(have_time()>=Period_learning && have_time()!=0 && have_patience()==true)Print("Я выучу язык MQL5!");
else Print("Я не выучу язык MQL5!");
You don't even need to comment on it.
ok
now make the algorithmic logic code more readable
it's only two lines:
if(have_time()>=Period_learning && have_time()!=0 && have_patience()==true)Print("Я выучу язык MQL5!");
else Print("Я не выучу язык MQL5!");
You don't even need to comment on that.
Hello, Renat! I agree, maybe I shouldn't write too many comments, but they will help all newbies with no knowledge of programming. If someone had done this work before me, the learning process would have been much faster. Comments will help to memorize my own code quicker. Perhaps the commentaries will be shorter in the future.
Regards, Vladimir.
Hello Roman! Yes, it is the consequence of technical education and my thinking logic is a bit different, but Peter was right about zero, so I changed the script code.
Regards, Vladimir.
I continue studying the MQL5 programming language and am posting the code of a script, which is a continuation of one task from the participants of this thread. The script has been tested in all modes. No problems detected. I have set the minimum number of input parameters to start with. The script code is written in English, the comments to the code are in Russian, to facilitate the learning. As I promised earlier, I tried to describe the script in a manner accessible to a 1st class student of the programming school.
Regards, Vladimir.
First, learn how to work with string variables from Dmitry Fedoseyev, infostringements are very foggy at the stage of studying other people's code,
The article he reviewed makes everything clear, and you will learn some of the details in passing, I'm speaking as a reader of most articles here, I think no one has read more than me)
Hello, thanks for the tip. I read Dmitry Fedoseyev's articles, but so far I'm having a hard time learning from his articles, as I have no basic training. Hopefully it will get easier. By the way, writing the Learning_MQL5.mq5 script helped me seriously to understand what a function is, what it is good for and how it is created!
Best regards, Vladimir.
The problems with logic remain:
Hello Peter! Knew you would have questions, especially on point 2.
The code here is not superfluous, but very clever. If you try to remove && have_time()!=0(you have written it as && have_time()>0) from the script code, the result will be "I will learn MQL5!" given the input parameters Period_learning=0 and Days_passed=0, and this is not permissible from the dogics viewpoint!
I agree with the other points - there is a lot to think about.
Regards, Vladimir.
Hello Peter! I knew you would have questions, especially on point 2.
The code here is not superfluous, but quite elaborate. If you try to remove && have_time()!=0(you wrote it as && have_time()>0) from the script code, the result will be "I will learn MQL5!" given the input parameters Period_learning=0 and Days_passed=0, and this is not permissible from the dogics viewpoint!
I agree with the other points - there is a lot to think about.
Regards, Vladimir.
Ok, look: the have_time() function essentially returns the value of the Days_passed input variable. If Days_passed is zero, then the entry if(...have_time()!=0... will not let us pass into the condition, but if Period_learning is zero, we will pass into the condition. So, writing Period_learning >0 will simultaneously protect us from zero in the Days_passed variable and from zero in the Period_learning variable, while writing if(... have_time()!=0 ... only against zero in Days_passed).
I see.
Respectfully, Vladimir.
I see.
Regards, Vladimir.
You have certainly made a serious step forward in the main - you have mastered and begun to use the functions, for which you are to be congratulated, of course!)
Thanks, Peter, for the words of encouragement!
As for polite conversations, especially greeting and wishing everyone good day and good mood. In my opinion it's very lacking in the forum. Respectful treatment of interlocutors is something our generation has been taught since Soviet times. If the administration of the site (forum) would reprimand me regarding welcoming to participants, I will take it into account and follow the rules.
Regards, Vladimir.