iHighest/iLowest doesn't work

 
I have tried to apply iHighest/iLowest in EA and it doesn't work at all. Any suggestion. Thanks.
 
Achmad Muchtar: I have tried to apply iHighest/iLowest in EA and it doesn't work at all. Any suggestion. Thanks.

Try place yourself in our shoes. How would you answer your own question?

Did you provide your example code for us to be able to analyse and point out problems?

If others are able to use the functions, then surely it works. If it does not work for you, then you must be doing it incorrectly.

But how are we going to know what you are doing wrong if we cannot see your code, or your computer or read your mind?

In other words, if you truely want help, then you have to be as detailed as possible with your question.

 
Fernando Carreiro #:

Try place yourself in our shoes. How would you answer your own question?

Did you provide your example code for us to be able to analyse and point out problems?

If others are able to use the functions, then surely it works. If it does not work for you, then you must be doing it incorrectly.

But how are we going to know what you are doing wrong if we cannot see your code, or your computer or read your mind?

In other words, if you truely want help, then you have to be as detailed as possible with your question.

Okay, I will give you the code and the details. I appreciate your attention. Thanks.

 
It doesn't trade.
Files:
 
Achmad Muchtar #: It doesn't trade.

You are using the functions incorrectly. The two functions iHighest and iLowest return an index or bar-shift, not the actual quote prices themselves.

Please read the documentation again, and have a look at the example code there.

iHighest

Returns the index of the highest value found on the corresponding chart (shift relative to the current bar)

iLowest

Returns the index of the smallest value found on the corresponding chart (shift relative to the current bar)

Here is another example ...

int    nHighest = iHighest( _Symbol, _Period, MODE_HIGH );
       nlowest  = iLowest(  _Symbol, _Period, MODE_LOW  );
double highest  = iHigh(    _Symbol, _Period, nHighest  ),
       lowest   = iLow(     _Symbol, _Period, nlowest   );

Your code also has several other problems, but I will leave up to you to analyse it properly.

 
Thank you Fernando, I'll work it out.
Reason: