[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 203

 

In terms of our usual sign int's, the process looks like this:

The count starts at zero, gets to 2^31-1 = 2147483647, or 0x7FFFFFFFF. The next number is 0x80000000, or -2^31 = -2147483648, i.e. it jumps to negative values (the highest bit becomes 1). Then counting is done by adding one until it reaches -1, i.e. 0xFFFFFFFFFFFF. The processor then sets the overflow flag and the counting cycle repeats from zero.

 
i.e. the counter returns a number between -2147483648 and 2147483647?
 
eddy:
i.e. the counter returns a number between -2147483648 and 2147483647?
Well, yes... read the help about int type, it says it there.
 
It all depends on the interpretation of the sign bit. Technically, the counter does not know about any negative numbers and considers the high bit of the number as its high digit. But there are no unsigned numbers in MQL, so the compiler will consider the high bit as a negative number. But the internal representation of the number does not change.
 
What numbers and in what order does GetTickCount() return?)
 
doon:

Question on isCloseLastPosByStop().

Will it check for the same closed order if there are no subsequent closed orders (i.e. this order will not be the last one)?

 
eddy:
and in what order does GetTickCount() return?)
0,1,2, ..., 2147483647, -2147483648, -2147483647, ..., -2, -1, (overflow) 0, 1, ...
 
doon:

Question on isCloseLastPosByStop().

Will it check for the same closed order if there are no subsequent closed orders (i.e. this order will not be the last one)?

It will always return the status of the last closed order. I.e. the answer is yes.
Or did you find a check for "order already checked once" somewhere in this function ? :)
 
artmedia70:
It will always return the status of the last closed order. I.e. the answer is yes.

Cp
 
doon:

Cp
I've corrected my previous post. Added a hint of what needs to be done :)