In OnCalculate() I have a ArraySetAsSeries with reverse order
Then I want the Lowest Value over a specific range. I do this with:
But this is not given me the correct value. I did a test for checking the program-line:
This gives me the values as shown in the attachment.
The red-arrow is the found value for low (plotted correctly by the program)The green-arrow is the found value for low (plotted correctly by the program)The blue-arrow is the found value for the lowest low in this range (plotted by the program)....?! Well this is ofcourse not the lowest low of this range.... but what I'm doing wrong??
I can't see what I'm doing wrong here..... :( Hope somebody gives me the light :D
Use "ArrayMinimum()" and not "iLowest()" in this case specifically! "iLowest()" works directly on the full history data (ordered as a Series Array), and not on the "low" array passed to the "OnCalculate()" function.
ArrayMinimum() - https://docs.mql4.com/array/arrayminimum
There is a difference between the arrays passed to OnCalculate (e.g. low) and the predefined variables (e.g. Low)
It works perfectly!!
x = low[ArrayMinimum(low,IdLastBullish-IdLastBearish,IdLastBearish)]
To add comments, please log in or register