Hi
I have a mql5 code which get failed at automatic validation process. Same code & logic works for mql4 with no problem. But in case mql5 is showing Tester too long time error in automatic validation page. In general, this indicator takes 2500msc to compile in mt5 as its a 4000+ line of codes which I can not decrease. Any option in such case to validate ?
Thank you
Regards
Optimize your code.
Is there any limit on the lines of coding?
What is the standard compilation time for automatic validation approval?
Update: I decreased the line of to 2400, now compilation time is 1860 msc. But automatic validation still fails. I have no error in the code also in backtest no error. Automatic validation shows Tester takes too long time. How to get rid of this problem?
Regards
Is there any limit on the lines of coding?
What is the standard compilation time for automatic validation approval?
Update: I decreased the line of to 2400, now compilation time is 1860 msc. But automatic validation still fails. I have no error in the code also in backtest no error. Automatic validation shows Tester takes too long time. How to get rid of this problem?
Regards
It has nothing to do with the number of lines or compilation time.
Optimize your code !
{
if(index < 0) return(-1);
ENUM_TIMEFRAMES timeframe = TFMigrate(tf);
datetime Arr[];
if(CopyTime(symbol, timeframe, index, 1, Arr)>0)
return(Arr[0]);
else return(-1);
}
int iBarShiftMQL4(string symbol,
int tf,
datetime time,
bool exact=false)
{
if(time<0) return(-1);
ENUM_TIMEFRAMES timeframe=TFMigrate(tf);
datetime Arr[],time1;
CopyTime(symbol,timeframe,0,1,Arr);
time1=Arr[0];
if(CopyTime(symbol,timeframe,time,time1,Arr)>0)
{
if(ArraySize(Arr)>2) return(ArraySize(Arr)-1);
if(time<time1) return(1);
else return(0);
}
else return(-1);
}
double iOpenMQL4(string symbol,int tf,int index)
{
if(index < 0) return(-1);
double Arr[];
ENUM_TIMEFRAMES timeframe=TFMigrate(tf);
if(CopyOpen(symbol,timeframe, index, 1, Arr)>0)
return(Arr[0]);
else return(-1);
}
{
if(index < 0) return(-1);
ENUM_TIMEFRAMES timeframe = TFMigrate(tf);
datetime Arr[];
if(CopyTime(symbol, timeframe, index, 1, Arr)>0)
return(Arr[0]);
else return(-1);
}
int iBarShiftMQL4(string symbol,
int tf,
datetime time,
bool exact=false)
{
if(time<0) return(-1);
ENUM_TIMEFRAMES timeframe=TFMigrate(tf);
datetime Arr[],time1;
CopyTime(symbol,timeframe,0,1,Arr);
time1=Arr[0];
if(CopyTime(symbol,timeframe,time,time1,Arr)>0)
{
if(ArraySize(Arr)>2) return(ArraySize(Arr)-1);
if(time<time1) return(1);
else return(0);
}
else return(-1);
}
double iOpenMQL4(string symbol,int tf,int index)
{
if(index < 0) return(-1);
double Arr[];
ENUM_TIMEFRAMES timeframe=TFMigrate(tf);
if(CopyOpen(symbol,timeframe, index, 1, Arr)>0)
return(Arr[0]);
else return(-1);
}
For sure they can and they do.
Hi I searched about it in here, I found your article . From there I used ibarshifFast code. But automatic validation is still falling as I still have iOpen,iTime code. Like the ibarshiftFast code is there any similar code available for iOpen or iTime alternatives which will load faster?
Thank you
little bit code improvement I can do from my side is ,
{
if(index < 0) return(-1);
double Arr[];
if(CopyOpen(symbol,timeframe, index, 1, Arr)>0)
return(Arr[0]);
else return(-1);
}
Hello, Thank you so much for the profiler suggestion, I am learning about it.
I got followings, in my case in build function oncalculate is taking 95% execution time. Now how to deal with it. I can not remove oncalculate.
Mt4 version has same, but it has no problem with automatic validation working fine.

- 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
I have a mql5 code which get failed at automatic validation process. Same code & logic works for mql4 with no problem. But in case mql5 is showing Tester too long time error in automatic validation page. In general, this indicator takes 2500msc to compile in mt5 as its a 4000+ line of codes which I can not decrease. Any option in such case to validate ?
Thank you
Regards