Questions from Beginners MQL5 MT5 MetaTrader 5 - page 504

 
Vladimir Fionov:
YES
if(counted == 0) limit-=1+Par1;

Instead of what I advised in the previous post, change to this line, it might work.

 

What is the error? I can not understand not much. I have output the strings for the condition also outputs itself. It's not about the condition above.

Solved!

Can anyone explain why this was the case?

 
Leanid Aladzyeu:

What is the error? I can't understand it much. I have output the strings for the condition also outputs itself. It's not about the condition above.

Solved!

Can someone explain to me why it was like this?

The operator ends with a semicolon. (;)
 
Victor Nikolaev:
The operator ends with a semicolon. (;)
Oh yes, thanks. I can't see the trivial stuff under my nose.
 

Wrote a system, it uses let's say 2 price levels (b8 and s8) to open positions which I save in variables like fractional, and in case the terminal restarts it loses these values I set Alert.

 if((в рынке ордеров>0 && (b8==0||s8==0))==false)

{

}

else Alert("Error");

Zero values are only set when there are 0 orders in the market. I checked in the test all is normal all is working, put on a real, and now has passed about a day -/+ 20 minutes and it starts to spit Alert (for a day it has opened 1 order and it was open).

What is the problem? Maybe in the lifetime of the variable?

 
Leanid Aladzyeu:

Wrote a system, it uses let's say 2 price levels (b8 and s8) to open positions which I save in variables like fractional, and in case the terminal restarts it loses these values I set Alert.

if((в рынке ордеров>0 && (b8==0||s8==0))==false)

       {

        }

        else Alert("Error");

Zeroing is set only when there are 0 orders in the market. I checked in the test, all normal, everything works, put on a real, and now has passed about a day -/+ 20 minutes and it begins to spit me Alert. (for the day he opened 1 order and it was open)

What is the problem? Maybe in the lifetime of the variable?

You need to compare variables with type double via NormalizeDouble()
 
Yury Reshetov:
Use NormalizeDouble() to compare variables of type double
0 is not a double type
 
Leanid Aladzyeu:
0 is not a double type.

And this crap, what type:

Leanid Aladzyeu:
... 2 price levels (b8 and s8)
and why is it compared to zero?
 
Yury Reshetov:

And this shit, of what type:

It clearly and explicitly says, "into a variable of the fractional type" :)))

You could get spit onby Alert for such questions :))

 
Yury Reshetov:

And this stuff, what kind of stuff:

and why does it compare to zero?
0 is for the notion of whether these levels are lost in case of loss the variables will equal 0 .
Reason: