Beta version of the online book on MQL4 programming - by Sergey Kovalev (SK.) - page 5
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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 tried to use my own example, but failed. Then I used the examples in the article and failed again. I saved the function and the Expert Advisor in the same folder.
Thanks. Now figuring out how to find out the maximum price at the last 40 bars.
Now figuring out how to find out the maximum price on the last 40 bars.
See Task 26 in Tutorial - Variables - Arrays.
Now figuring out how to find out the maximum price on the last 40 bars.
See Task 26 in Tutorial - Variables - Arrays.
If the variable Mu minus the variable UD multiplied by the point price is greater than or equal to Ask and at the same time the variable _OrdersTotal is not equal to 1, then the variable Opn_B is assigned the value true. That is, only if these two conditions are met the variable Opn_B is assigned the value true. And if a comma is put instead of &&, then true is assigned when at least one of the conditions is met.
Am I reading the if statement condition correctly?
If the variable Mu minus variable UD multiplied by the point price is more or equal to Ask and at the same time the variable _OrdersTotal is not equal to 1, then the variable Opn_B is assigned the value true. That is, only if these two conditions are met the variable Opn_B is assigned the value true. And if a comma is put instead of &&, then true is assigned when at least one of the conditions is met.
This is correct in general.
But the expression specified in the if() statement header is a boolean one. It does not imply the possibility of "comma". In order to implement the second option you describe, it is necessary to put || (logical OR) instead of && (logical AND). In this case, the whole expression in the header (in parentheses) will be true if at least one of the expressions separated by || is true.
The use of parentheses is allowed. Parentheses have higher priority in calculations (like normal arithmetic calculations).
The other day we launched the beta version of Sergei Kovalev's(SK.) online book on MQL4 programming.
https://book.mql4.com/ru
For now only Russian version works, but we will try to translate it to English and Chinese
If you have any comments about the book, please let us know.
I have two different computers and different browsers, but the pictures on https://book.mql4.com/ru/metaeditor/compose do not work.
On two different computers and with different browsers, the images on https://book.mql4.com/ru/metaeditor/compose are not showing.