//+------------------------------------------------------------------+
//|                                                 HILOW Colour.mq4 |
//|                      Copyright © 2006, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
#property link      "cja"
#property indicator_chart_window
#define BFRAME "BFRAME"
#define HIGH "HIGH"
#define LOW "LOW"
#define DFRAME "DAYFRAME"
extern color HLcolour = Navy;


extern int D = 0; //How many days back /0 = curr day/ 1 = yesterday/ 2= 2days ago
extern int B = 0; //Today = 0/ yesterday = 1 / 2days ago = 2 



//+------------------------------------------------------------------+
//| Define the Variables to use.....                                 |
//+------------------------------------------------------------------+
int shift=0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
 
  
  
//----
   return(0);
  
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
 {
CreateHL();
}
void CreateObj(string objName, double start, double end, color clr)
  {
   ObjectCreate(objName, OBJ_RECTANGLE, 0, iTime(NULL,PERIOD_D1,D), start, Time[0], end);
   
    }
   void DeleteObjects()
   {
   ObjectDelete(BFRAME);
   ObjectDelete(HIGH);
   ObjectDelete(LOW);
   ObjectDelete(DFRAME);
   }
   void CreateHL()
   {
   DeleteObjects(); 
  
  double HDAILY = iMA(Symbol(),PERIOD_D1,1,0,MODE_HIGH,PRICE_HIGH,B);
  double LDAILY = iMA(Symbol(),PERIOD_D1,1,0,MODE_LOW,PRICE_LOW,B); 
 
  CreateObj(DFRAME, HDAILY, LDAILY, HLcolour);
 
  ObjectCreate("high", OBJ_LABEL, WindowFind("PT"), 0, 0);
        ObjectSetText("high",DoubleToStr(HDAILY,Digits), 15, "Arial Bold", Coral);
        ObjectSet("high", OBJPROP_CORNER, 0);
        ObjectSet("high", OBJPROP_XDISTANCE, 175);
        ObjectSet("high", OBJPROP_YDISTANCE, 42);
        
  ObjectCreate("low", OBJ_LABEL, WindowFind("PT"), 0, 0);
        ObjectSetText("low",DoubleToStr(LDAILY,Digits), 15, "Arial Bold", Coral);
        ObjectSet("low", OBJPROP_CORNER, 0);
        ObjectSet("low", OBJPROP_XDISTANCE, 315);
        ObjectSet("low", OBJPROP_YDISTANCE, 42);      
    
}
return(0);

 

//+------------------------------------------------------------------+