Custom indicator won’t call alerts from offline charts

 
I created a custom indicator but it will not call alerts from offline renko chart. Can anybody help me to resolve this? It will call alerts fine on live chart. The alert code is below.

void myAlert(string type, string message)
  {
   int handle;
   if(type == "print")
      Print(message);
   else if(type == "error")
     {
      Print(type+" | Tori Money Line @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
     }
   else if(type == "order")
     {
     }
   else if(type == "modify")
     {
     }
   else if(type == "indicator")
     {
      Print(type+" | Tori Money Line @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
      if(Audible_Alerts) Alert(type+" | Tori Money Line @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
      if(Send_Email) SendMail("Tori Money Line", type+" | Tori Money Line @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
      handle = FileOpen("Tori Money Line.txt", FILE_TXT|FILE_READ|FILE_WRITE|FILE_SHARE_READ|FILE_SHARE_WRITE, ';');
      if(handle != INVALID_HANDLE)
        {
         FileSeek(handle, 0, SEEK_END);
         FileWrite(handle, type+" | Tori Money Line @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
         FileClose(handle);
        }
      if(Push_Notifications) SendNotification(type+" | Tori Money Line @ "+Symbol()+","+IntegerToString(Period())+" | "+message);
     }
 
 
Please insert the code correctly: when editing a message, press the button      Codeand paste your code into the pop-up window