How to properly make BACK TEST of the Expert Advisor using the Time[0] function ?

 


My Expert generates a few signals, but I would like to make the validity of these signals on 5 or 7 bars (the signal should be not valid after 5th or 7th bar).

I 've added the NewBar function to my expert, but I am not sure if that function will be good tested on Meta Trader using the Back Tester.


extern datetime PreviousBar;


init() {}

deinit() {}

start() {...}


bool NewBar()
{
if(PreviousBar<Time[0])
{
PreviousBar = Time[0];
return(true);
}
else
{
return(false);
}
return(false); // in case if - else statement is not executed
}





Have anybody any good idea how to properly back test the experts where are used in the Time[] functions ?

Or replace the NewBar() function the other function or variable ?