//+------------------------------------------------------------------+ 
//|   TRO_HL                                                         | 
//|                                                                  | 
//|   Copyright © 2008, Avery T. Horton, Jr. aka TheRumpledOne       |
//|                                                                  |
//|   PO BOX 43575, TUCSON, AZ 85733                                 |
//|                                                                  |
//|   GIFTS AND DONATIONS ACCEPTED                                   | 
//|   All my indicators should be considered donationware. That is   |
//|   you are free to use them for your personal use, and are        |
//|   under no obligation to pay for them. However, if you do find   |
//|   this or any of my other indicators help you with your trading  |
//|   then any Gift or Donation as a show of appreciation is         |
//|   gratefully accepted.                                           |
//|                                                                  |
//|   Gifts or Donations also keep me motivated in producing more    |
//|   great free indicators. :-)                                     |
//|                                                                  |
//|   PayPal - THERUMPLEDONE@GMAIL.COM                               |  
//+------------------------------------------------------------------+ 

#property indicator_chart_window

extern int    myPeriod      = 0 ;  
extern int    myShift       = 0 ;  
extern int    Line_Style    = STYLE_SOLID ;
extern int    Line_Width    = 1 ;

extern color  Line_Color_Hi = Lime ;
extern color  Line_Color_Lo = Red ;

string lbl[15], lbl2[15];
int n, j, i ;

string symbol, tChartPeriod, ShortName ;  

int    digits, period, win ; 

double point ;

double    HHprice, LLprice ;
 
      
//+------------------------------------------------------------------+

int init()
{
   if(myPeriod == 0) { period = Period() ; } else { period = myPeriod ; }  

   symbol       =  Symbol() ;
   digits       =  Digits ;
   point        =  Point ;
   ShortName    =  "trohl"+symbol+period+myShift  ;
   
   
 
   return(0);
  }
  
//+------------------------------------------------------------------+
int deinit()
{
 
ObjectsDeleteAll();
 
return(0);
}
  
//+------------------------------------------------------------------+
int start()
{

n       = 10;
 
j       = 0 ;
 
HHprice = iHigh(symbol,period,myShift);  
LLprice = iLow(symbol,period,myShift);  
 
j       = j + 1 ;
lbl[j]  = ShortName+j;
drawLine(LLprice ,lbl[j], Line_Color_Lo , Line_Style ) ;

j       = j + 1 ;
lbl[j]  = ShortName+j;
drawLine(HHprice ,lbl[j], Line_Color_Hi , Line_Style ) ;

return(0);
}
 

//+------------------------------------------------------------------+
 
void drawLine(double lvl,string name, color Col,int type)
{
         if(ObjectFind(name) != 0)
         {
            ObjectCreate(name, OBJ_HLINE, 0, Time[0], lvl,Time[0],lvl);
            

            ObjectSet(name, OBJPROP_STYLE, type);

            
            ObjectSet(name, OBJPROP_COLOR, Col);
            ObjectSet(name,OBJPROP_WIDTH,Line_Width);
            
         }
         else
         {
            ObjectDelete(name);
            ObjectCreate(name, OBJ_HLINE, 0, Time[0], lvl,Time[0],lvl);
            
            ObjectSet(name, OBJPROP_STYLE, type);
            
            ObjectSet(name, OBJPROP_COLOR, Col);        
            ObjectSet(name,OBJPROP_WIDTH,Line_Width);
          
         }
 
}
 
//+------------------------------------------------------------------+
/*

Comment(

"ind_bufferOp[0]" , ind_bufferOp[0] , "\n" ,   
 

"") ; 
*/