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.
RTFM There is a difference between the arrays passed to OnCalculate (e.g. low[]) and the predefined variables (e.g. Low[]) | To determine the indexing direction of time[], open[], high[], low[], close[], tick_volume[], volume[] and spread[], call ArrayGetAsSeries(). In order not to depend on default values, you should unconditionally call the ArraySetAsSeries() function for those arrays, which are expected to work with. |
Thanks!
It works perfectly!!
x = low[ArrayMinimum(low,IdLastBullish-IdLastBearish,IdLastBearish)]
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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[12162] (plotted correctly by the program)
The green-arrow is the found value for low[12178] (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
Regards,