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
In fact, the condition above is always true, like 2 = 2. That's why if (the condition operator) doesn't work here and the compiler will generate a warning for this code.
Hello Peter! The compiler hasn't generated any warnings.
Regards, Vladimir.
I must have misunderstood something, as there is such a reaction.
I wrote the following condition in the script New6.mq5: "For pending orders Buy Stop and Sell Stop, apply the #define directive instead of input. It will allow us to specify in the script code the necessary types of pending orders, but they will not be displayed in the input parameters of the script when it runs. Let's set variables defining the types of pending orders orderType1 and orderType2. Let's name these variables "BUY_STOP" and "SELL_STOP".
Please advise me what I have done wrong in the implementation of this condition.
Regards, Vladimir.
I must have misunderstood something, as there was such a reaction.
Sincerely, Vladimir.
Respected forum memberKoldun Zloy gave you a detailed answer. There was an error in the macro. Why did you start using macros in the first place? Why do you need them in this task? Macros are a powerful tool that you can easily kill yourself with. But the first thing you do is start using macros.
Hello Peter! The compiler hasn't generated any warnings.
Regards, Vladimir.
Everything is all right. In fact, there is no condition as there is no condition in the if (2 == 2) expression. This is a common, everyday logic. :)
I understand that for programming experts my bloopers look clumsy. Maybe I have made a wrong condition of writing code for myself?
Sincerely, Vladimir.
You, respected forum memberKoldun Zloy gave a detailed answer. The error is in the macro. Why did you start using macros at all? Why do you need them in this task? Macros are a powerful tool that you can easily kill yourself with. But the first thing you do is start using macros.
So, I haven't figured it out yet, and there are some things to work on.
Regards, Vladimir.
The idea is to give a warning prompting to check the condition. (The yellow triangle in the compile window).
It shouldn't, there's a value on the right and a substitution on the left, so that's correct.
I understand that for programming experts my bloopers look clumsy. Maybe I have made a wrong condition of writing code for myself?
Sincerely, Vladimir.
You started your studies in a wrong way. Do you understand everything that is written in the code? All operators, key words?
A follow-up question about the code:
What do these lines mean?
Supposedly it should have generated a warning prompting you to check the condition. (The yellow triangle in the compilation window).
Checked a few more times - the compiler doesn't give out anything.
Regards, Vladimir.
I understand that for programming experts my bloopers look clumsy. Maybe I have made a wrong condition of writing code for myself?
Sincerely, Vladimir.