Downloaded data doesn't match compared to code debugging

 

Hi,

I'm finding that the data downloaded from MT5 doesn't match when stepping through during debugging. Example below.

Data downloaded from MT5 as follows:

Ctrl U > Bars > EURUSD M1 > date range 03 Apr 2019 to 5 Apr 2091


Code I have as follows: 

int lastbarcount=0;
void OnTick()
  {
   if (Bars(_Symbol, _Period) > lastbarcount) 
   {datetime r=TimeCurrent();  
   lastbarcount = Bars(_Symbol, _Period);
   double closeprice= iClose(NULL,PERIOD_CURRENT,0);}
   }

Debug options: EURUSD, M1, date range: 3 Apr 2019-5 Apr 2019; Execution without delay 1 minute OHLC; USD100000 deposit, 1:100 leverage.

Stepping through the debug start/resume I get the following results (I have skipped to 12.08AM):

r=D'2019.04.03 00:08:00, closeprice:1.12032
r=D'2019.04.03 00:09:00, closeprice:1.1200300000000001
r=D'2019.04.03 00:10:00, closeprice:1.1200600000000001

The data from the downloaded csv gives:

DATE TIME CLOSE
2019.04.03 00:08:00 1.12001
2019.04.03 00:09:00 1.12006
2019.04.03 00:10:00 1.12022

Why don't the close prices match? The first line is well off.

Thanks.

 

Someone help please? 

Thanks....