Hi,
I’ve added a log-list showing the systematic error with iBarShift.
I’ve changed the color of the record in the list where the problem arises.
You will see that one hour is skipped when I go minute per minute back in time over 1440 minutes (= 1 day).
The backtester is doing this systematically and never shows 1440 minutes in a day. 1 hour is dissapeared !!!!!!
I’ve also tested this with version 1.7 and the problem remains the same.
Here’s the code I’ve written to show the problem;
previousday_start = iTime(NULL,PERIOD_D1,i);
previousday_end = previousday_start + 24*60*60 -60;
start_bar = iBarShift(NULL,PERIOD_M1,previousday_start);
end_bar = iBarShift(NULL,PERIOD_M1,previousday_end);
// ***** ONLY FOR TEST *****
datetime testtime;
int currentbar=0;
int end = end_bar+1440;
Log(“end_bar = ” + end_bar + “start_bar = ” + start_bar);
for (i= end_bar; i< end; i++)
{
testtime = iTime(NULL, PERIOD_M1, i);
currentbar = iBarShift(NULL,PERIOD_M1,testtime);
Log( “i = ” + i + ” Time = ” + TimeToStr(testtime,TIME_DATE|TIME_SECONDS) + ” BarNr = ” + currentbar);
}
Log (“end of cycle”);
// ***** ONLY FOR TEST TILL HERE *****