ArrayMinumun () returning last value
ArrayMinumun () returning last value
Loading saved threads...
Pinto André · External communityPost link
External question — Stack Overflow Stack Exchange
Author: Pinto André
Original post: https://stackoverflow.com/questions/67143879
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
i'm trying to find the lowest value in an array that is determined between the last closed order and Timecurrent().
I'm always getting the last value of the buffer instead the minimum value of the array.
I've tried to change every parameter but so far no luck.
Please could you help me out?
int ArrayCalcMin()
{
datetime Timeorder=LastOrderTime();
datetime Timeahora=TimeCurrent();
datetime Times=Timeahora-Timeorder;
int m = TimeMinute(Times);
int h = TimeHour(Times);
int d = TimeDay(Times);
int bars = (((d-1)*24*60)+(h*60)+m)/240;
int malookback=bars;
double madaily[30000];
double dllv;
for(int i = 1; i < malookback; i++)
{
madaily[i] = iCustom(NULL,0,"Scolor8",0,i);
dllv = iCustom(NULL,0,"Scolor8",0,
ArrayMinimum(madaily,WHOLE_ARRAY,0));
}
Print("Minimum value : ",dllv);
if (dllv < 50){return(1);malookback=0; }
else {return(0);malookback=0;}
}
Thank you in advance.
KR
Andrés
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External question — Stack Overflow Stack Exchange Author: Pinto André Source score (net votes, not local likes): 0 Original post: https://stackoverflow.com/questions/67143879 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. i'm trying to find the lowest value in an array that is determined between the last closed order and Timecurrent(). I'm always getting the last value of the buffer instead the minimum value of the array. I've tried to change every parameter but so far no luck. Please could you help me out? int ArrayCalcMin() { datetime Timeorder=LastOrderTime(); datetime Timeahora=TimeCurrent(); datetime Times=Timeahora-Timeorder; int m = TimeMinute(Times); int h = TimeHour(Times); int d = TimeDay(Times); int bars = (((d-1)*24*60)+(h*60)+m)/240; int malookback=bars; double madaily[30000]; double dllv; for(int i = 1; i < malookback; i++) { madaily[i] = iCustom(NULL,0,"Scolor8",0,i); dllv = iCustom(NULL,0,"Scolor8",0, ArrayMinimum(madaily,WHOLE_ARRAY,0)); } Print("Minimum value : ",dllv); if (dllv < 50){return(1);malookback=0; } else {return(0);malookback=0;} } Thank you in advance. KR Andrés
Checking account access…