Hi all,
i'm trying to calculate the minimum value of an array but the following error occurs: EURUSD,H4: incorrect start position 0 for ArrayMinimum function
Please find below the code that i'm using:
Please could you gime some tip in how can i solve this?
thank you.
KR
Hi all,
Thank you in advance.
So what i are trying to determine is the low value of the stochcastic value (provided by the icustom) between the last trade until now.
If the minimun value is below 50 the return is 1 else 0.
thank you.
AP
Hi all,
Thank you in advance.
So what i are trying to determine is the low value of the stochcastic value (provided by the icustom) between the last trade until now.
If the minimun value is below 50 the return is 1 else 0.
thank you.
AP
You want us to solve your issue, right?
You could go and read the docs, but its so much more convenient to ask....
// Local init double indicator_values[]; const int h_indicator = iCustom(....); CopyBuffer(h_indicator, ..., indicator_values); const int min_val_index = ArrayMinimum(indicator_values, 0); if(indicator_values[min_val_index] < 50) { // *** Condition met *** // return(0x01); } return(0x00);
Ohh, as a challenge, this code is for mql5....
Thank you Dominik, every help is welcome.
I really tried reading the documentation, but i'm stuck in this issue.
Nonetheless, could you point me to right direction for mql4?
Also in the code that you attached, in the indicator_values, how do you determine the length of the array?
in this case i'm trying to calculate the distance between the last order and now().
Regards.
AP
Hi Keith,
The size of the array depends on the number of bars between the last trade and the time current() ( converted in 4H timeframe).
Is that what you are asking?
datetime Timeorder=LastOrderTime(); datetime Timeahora=TimeCurrent(); datetime Times=Timeahora-Timeorder; int m = TimeMinute(Times); int h = TimeHour(Times); int bars = ((h*60)+m)/240; int malookback=bars;
Thank you.
Hi Keith,
The size of the array depends on the number of bars between the last trade and the time current() ( converted in 4H timeframe).
Is that what you are asking?
Thank you.
No, I am asking where do you size the array?
Hi again,
I think that should be here ->
double madaily[];
I've put a random value between the [] as 1.000 and the function works. but I don't really know what is means or how can i calculate it.
Now I see that the bar count isn't correct. I will double check again the calculation.
Please let me know if is anything else that i can improve in the code.
Thank you.
AP
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
i'm trying to calculate the minimum value of an array but the following error occurs: EURUSD,H4: incorrect start position 0 for ArrayMinimum function
Please find below the code that i'm using:
Please could you gime some tip in how can i solve this?
thank you.
KR