Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 525
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
If you specified rost without a value, it defaults to false
Can you explain how this relates to my post#5237? I don't understand it at all.
Can you explain how this relates to my post#5237? Because I don't understand it at all.
Good afternoon!
Question on mcl4 syntax: if I set a flag like this:
then the if(!rost) condition will catch only the condition for rost=false or all conditions not falling under rost=true?
Thanks.
You asked. Will all conditions that are not true get caught. You only have two checks. But if the check is not true, then the check is false. The second line doesn't matter because you have rost = bool and can only take 2 values and it defaults to false
So, all conditions not falling under the true condition will automatically be false and so the if(!rost) entry will capture both the condition (op1>cl2 && cl1<cl2) and the condition (op1<cl2 && cl1>cl2).Right?
just don't forget to initialise "rost".
How?
So, all conditions not falling under the true condition will automatically be false and so the if(!rost) entry will capture both the condition (op1>cl2 && cl1<cl2) and the condition (op1<cl2 && cl1>cl2).Right?
How?
Bool rost=false;
But I just want to avoid a situation where !rost captures all conditions for rost != true. So I did not initiate Bool rost=false at global level, but initiate onTick() separately for false and separately for true. Perhaps, to avoid confusion, it is better to set conditions not if(rost) and if(!rost) but if(rost==true) and if(rost==false) ?
Or then introduce another fla that restricts the conditions of !
But I just want to avoid a situation where !rost captures all conditions for rost != true. So I did not initiate Bool rost=false at global level, but initiate onTick() separately for false and separately for true. Perhaps, to avoid confusion, it is better to set conditions notif(rost) and if(!rost), but if(rost==true) and if(rost==false) ?
Absolutely identical entries.
Absolutely identical entries.
This correspondence just shows that in my caseif(!rost) is not the same asif(rost==false). Becausethere is a separate condition forfalse.