How to use || at int? - page 2

 
William Roeder #:

I misread that previously. You get true if close[i] is not the lowest value. Not what OP wants.

Are you sure about "Not what OP wants"? I understood the first post on this thread like what I wrote in code.

It was asked:

"It is mean that close 0 is above all closes of the last 900 candles,

but i need to say that close 0 is above close 1 or above close 2 ... to the last 900 candles!"

Isn't that exactly what my post reflects?

... In the end, doesn't matter, don't want to discuss this. - Just want to understand where I went wrong here.



 
Ahmed Abd El Aziz:

Hello


I am a beginner, i just try to say:



It is mean that close 0 is above all closes of the last 900 candles,

but i need to say that close 0 is above close 1 or above close 2 ... to the last 900 candles!


when i write:



it dose not work of course and i know that, but i need something like this to use!

First, in an indicator, you don't need to copy rates prices ... 

Then, if the current close is higher than the lowest close price among the last 900 candles ... it means that the current close is logically higher than 1 || 2 || 3 || ... 900 ... backward

if(close[0] > close[ArrayMinimum(close, 1 ,900)])

Finally, you should learn to avoid looping inside a loop ... MT indicator/experts are mono threaded and synchronous but it's another problem that has been discussed already somewhere in the forum.

 
Icham Aidibe #:

First, in an indicator, you don't need to copy rates prices ... 

Then, if the current close is higher than the lowest close price among the last 900 candles ... it means that the current close is logically higher than 1 || 2 || 3 || ... 900 ... backward

Finally, you should learn to avoid looping inside a loop ... MT indicator/experts are mono threaded and synchronous but it's another problem that has been discussed already somewhere in the forum.

You are a king, thank you.

 
Icham Aidibe #:

First, in an indicator, you don't need to copy rates prices ... 

Then, if the current close is higher than the lowest close price among the last 900 candles ... it means that the current close is logically higher than 1 || 2 || 3 || ... 900 ... backward

Finally, you should learn to avoid looping inside a loop ... MT indicator/experts are mono threaded and synchronous but it's another problem that has been discussed already somewhere in the forum.

Thanks for explanation.

 
William Roeder #:

I misread that previously. You get true if close[i] is not the lowest value. Not what OP wants.

Now I understood.... OMG. Took a while.