strange problem with testing

 

I relized thet I have a serious problem while testing a strategy: using the same EA I obtain very different results using exactly the same parameters on the tester.

The script I'm going to show you is written for counting bars when they come out, but MetaTrader jumps some ones!!

example:

Test1: 1,2,3,4,5,6,7,8,9,10,24,25,26,27....
Test2: 1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17...

This is the algorithm:


int cont;
datetime last;


int init()
{
//----
last=Time[0];
//----
return(0);
}



int start()
{
//----
if(Time[0]!=last)
{
last=Time[0];
cont++;
}
Print("new bar: "+cont);
//----
return(0);
}


 
Can you show the actual code you run . . . and the actual output.
 

thank's for interest!


The full code is this:

//+------------------------------------------------------------------+
//| nuovotick.mq4 |
//| Copyright © 2011, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
int cont;
datetime last;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
last=Time[0];
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
if(Time[0]!=last)
{
last=Time[0];
cont++;
}
Print("new bar: "+cont);
//----
return(0);
}
//+------------------------------------------------------------------+


And the output is this: (More ticks for each bar is normal...but as you can see there is a jump from 11 to 17, in another test the jump could be (at random) from 18 to 20)



 
OK, now open the log file in tester/logs and find the same entries . . . the entries in the journal sometime miss entries because it is moving too fast, the log file will always be complete. If the log file is OK then you haven't missed any bars . . .
 
Perfect!!! you are a nice person!
 
LucaPennisi:
Perfect!!! you are a nice person!
:-) thank you. You are welcome.
Reason: