//+------------------------------------------------------------------+
//|                                                  HLine indicator.mq4 |
//+------------------------------------------------------------------+

#property indicator_chart_window
extern int   HOUR                = 4; //Hour to draw the lines
extern int   MINUTE              = 0; //Minute to draw the lines
extern string LineName="MyLineL";
extern string LineName1="MyLineH";
extern color Line_Color          = clrYellow; //Color of the lines
input ENUM_LINE_STYLE Line_Style = STYLE_SOLID; //Style of the lines

string name = "TimeLine";
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   ObjectsDeleteAll(0,name);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
void start()
  {
    int Counted_bars=IndicatorCounted();
    int i=Bars-Counted_bars-1;
   
    while(i>=0)                       
     {  
      if(TimeHour(Time[i]) == HOUR && TimeMinute(Time[i]) == MINUTE)
      {
         if (ObjectFind(name+DoubleToStr(Time[i])) != 0)
        {
            ObjectsDeleteAll(0,name);
            
            ObjectCreate(LineName, OBJ_HLINE, 0, 0, Low[i]);
            ObjectCreate(LineName1, OBJ_HLINE, 0, 0, High[i]);
         }
       }
     i--;
     }
  
  }
//+------------------------------------------------------------------+