//+------------------------------------------------------------------+
//|                                HiLine Drag & Drop MTF Colors.mq4 |
//|                                                           By cja |
//+------------------------------------------------------------------+
#property copyright "cja"



 extern int  Hline_Width     = 2;
 extern int  Hline_Style     = 0; 

//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
//----
   double      Hline = WindowPriceOnDropped();
   int         timeframe = Period();
   color       Linecolor;

   switch(timeframe)
      {
      case 1      : Linecolor = Red;        break;
      case 5      : Linecolor = Green;      break;
      case 15     : Linecolor = Aqua;       break;
      case 30     : Linecolor = DodgerBlue; break;
      case 60     : Linecolor = White;      break;
      case 240    : Linecolor = Gold;       break;
      case 1440   : Linecolor = Pink;       break;
      case 10080  : Linecolor = Magenta;    break;
      case 43200  : Linecolor = Violet;     break;
      }
  
         ObjectCreate("Hi_Line"+TimeCurrent(),OBJ_HLINE,0,Time[0],Hline);        
         ObjectSet("Hi_Line"+TimeCurrent(),OBJPROP_COLOR,Linecolor);
         ObjectSet("Hi_Line"+TimeCurrent(),OBJPROP_PRICE1,Hline);
         ObjectSet("Hi_Line"+TimeCurrent(),OBJPROP_WIDTH,Hline_Width);
         ObjectSet("Hi_Line"+TimeCurrent(),OBJPROP_STYLE,Hline_Style);
         
//----
   return(0);
  }
//+------------------------------------------------------------------+