Is anyone fix this problem in my indicator?

 

I created an graphic indicator that show prices and my local time when i move mouse cursor. But sometimes when i change time frame, when chart appear "Waiting for Update" and then my indcator does not work when i move mouse like this :My graphic

Files:
 

i think this problem is caused by chart redraw. But when i write these code :

bool IsChartRedraw()

{

   if(MathAbs(curbars-Bars)>1){

      curbars=Bars;

      return(true);

   }

   else return(false);

 

it only check right when chart is start appear, when i scroll to an end of chart, it didn't work. Please,help me !

Reason: