Incorrect Today Close data

 
Hi
Please
Take a look below code wich is satistical Key Reversal

//+------------------------------------------------------------------+
//|                                                         Stat.mq4 |
//|                      Copyright © 2006, MetaQuotes Software Corp. |
//|                                                                  |
//+------------------------------------------------------------------+
#include <stdlib.mqh>
#property copyright "Statiscal study"
#property link      ""

extern int Shift=0;
double KR,KRP,LastBar;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   Print("Total KeyReversal ",KR," Positive ",KRP ," ", NormalizeDouble((KRP/KR)*100,0),"%");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
{
//----
 if(Bars > LastBar)
 { 
   if((Low[1] < Low[2]) && (Close[1] > Close[2]))
   {
      LastBar=Bars;
     
      if(Close[0] > Close[1]) // [b]<<--- RANDOM ERROR !!!![/b]
      {
         
         Print("Last ",Close[0]," Prev " ,Close[1] );
         if(ObjectCreate("KRPos"+DoubleToStr(KRP,1),OBJ_ARROW,0,Time[1],Low[1]))
         {
              
             ObjectSet("KRPos"+DoubleToStr(KRP,1),OBJPROP_COLOR, Blue);
         } else return(0);
         KRP++;
      }
      KR++;
   }
  
 }
//----
   return(0);
}
//+------------------------------------------------------------------+


Save as EA (NOT Indicator) and try it in Daily period
Recalculate with "Open prices..." and plot graph
There are a lot of wrong KeyReversal Pattern due to erratic value of today Close[0]
Sametime Close[0] has same value of previuos day CLose[1](look log file) with only last digit different

For example EURUSD day August 10th 2006
Print log is
2006.12.14 00:54:48 2006.08.10 00:00 Stat EURUSD,Daily: Last 1.2864 Prev 1.2863
Historical Close data of August
08 1.2821
09 1.2863 <-Prev Close
10 1.2793 <-Today Close


What's a bug or my mistake ?

B.-