Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1328

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
The question seems to be about MT5. The answer is: Not programmatically. The question can be closed.
Thank you
Good afternoon everyone, as promised I'm back for more tutorialsЈ ;-) Of course I got the grail machine running, but it's been slow in testing so I've been searching for ways to execute code within it tick only when new bar arrives. Found the following option. On the global level, a variable is defined
Then I wrote a function that checks whether a new bar has occurred - this is a masterpiece
When I found this variant, they say that I should create a function with all the logic from the on-tick. I don't like this approach with functions, frankly speaking, so I just check if there is a new bar and if it's true, I will execute code in the on-tick. In simplified form - without any real work it looks like this
I have a different question. The grail will of course work on the real case. So, this check should be removed in the version of the grail that will not be tested in the tester but will be executed on the real tick, so that the EA will operate on every tick, or should we leave this check for the real tick as well? If this check is also included into the real account version, how should we plan a second attempt to open orders if they were not opened the first time?
Good afternoon everyone, as promised I'm back for more tutorialsЈ ;-) Of course I got the grail machine running, but it's been slow in testing so I've been searching for ways to execute code within it tick only when new bar arrives. Found the following option. On the global level, a variable is defined
Then I wrote a function that checks whether a new bar has occurred - this is a masterpiece
When I found this variant, they say that I should create a function with all the logic from the on-tick. I don't like this approach with functions, frankly speaking, so I just check if there is a new bar and if it's true, I will execute code in the on-tick. In simplified form - without any real work it looks like this
I have a different question. The grail will of course work on the real case. So, in the version of the grail that will not be tested in the tester but will work on the real account, should we remove this check to make the EA work on every tick or should we leave it for the real account as well? If this check is also included into the real account version, how should we plan a second attempt to open orders if they were not opened the first time?
If calculations are performed on bar values of OPT, HI, LO, CLOSES, we don't need to count on every tick. But it is correct to monitor the price on every tick. This should be separate calculations or condition checks.
The new bar is also tracked by the zero bar opening time.
In this thread I want to begin to help those who really want to understand and learn programming in the new MQL4 and want to easily switch to MQL5 - the languages are very similar.
This blog will be a good place to discuss problems, algorithms of their solution and any other questions concerning MT programming one way or another.
I hope that other experienced members of our forum will join the discussion and the branch will be interesting to all.
MQL4 Tasks: Determine the position number of a capital letter in a string. Thank you.
MQL4 Task: Determine the position number of a capital letter in a string. Thank you.
Thank you.
Thank you.
Wrong, it's not the StringFind result we want, it's the i.
Right:
MQL4 Task: Determine the position number of a capital letter in a string. Thanks.
You can use StringGetCharacter() The character "A" is 65 and "a" is 32 more - 97. And so are all the characters. Hence, if a character code is > 90 and <= 122, it is a lowercase Latin character. Cyrillic characters also differ by 32
You can
Exactly, a good option.