Fibonacci Time Zone different colors (updated)

 

Hi all,

I'm looking for an indicator (Metatrader4) about Fibonacci Time Zone that allows to modify colors about every single line (like the image I posted below).
I tried an indicator that works well for me, but there is no possibility to modify colors of every line. Please let me know. if exists. where I can find this indicator, or I'd appreciate it if you suggest me changes for this code, if is not much difficult. I forgot the code before...
Thanks in advance for your help and reply.
Regards.


Manuel

#property indicator_chart_window
double   price0, price1, priceE0, priceE1,priArr;
int levels, resultX, resultY, z=0;
datetime time0,time1,timeE0,timeE1,timArr;
//+------------------------------------------------------------------+
int OnInit(){
   price0 = 0.5*(ChartGetDouble(0,CHART_PRICE_MIN,0) + ChartGetDouble(0,CHART_PRICE_MAX,0));
   price1 = price0;  priceE0 = price0;  priceE1 = price0;
   
   resultX = ChartGetInteger(z,CHART_WIDTH_IN_PIXELS,z)/5;
   resultY =(int)(ChartGetInteger(z,CHART_HEIGHT_IN_PIXELS,z)/2);
   
   ChartXYToTimePrice(0, 4*resultX, resultY, z, timArr, priArr);  timeE1  = timArr; 
   ChartXYToTimePrice(0, 3*resultX, resultY, z, timArr, priArr);  timeE0  = timArr; 
   ChartXYToTimePrice(0, 2*resultX, resultY, z, timArr, priArr);   time1 = timArr;
   ChartXYToTimePrice(0,   resultX, resultY, z, timArr, priArr);   time0 = timArr;
   
       
       ObjectDelete(0,"p");
       ObjectCreate(0,"p", OBJ_FIBOTIMES, z, time0, price0, time1, price1);
       ObjectSetInteger(0,"p",OBJPROP_LEVELS,2);
       ObjectSetDouble(0,"p",OBJPROP_LEVELVALUE,1,1); 
       ObjectSetString(0,"p",OBJPROP_LEVELTEXT,0,"A");
       ObjectSetString(0,"p",OBJPROP_LEVELTEXT,1,"B");
       ObjectSetInteger(0,"p",OBJPROP_COLOR,clrCadetBlue);
       
       ObjectDelete(0,"q");
       ObjectCreate(0,"q", OBJ_FIBOTIMES, z, timeE0, priceE0, timeE1, priceE1);
       
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
void OnDeinit(const int reason){
   Comment("");
   ObjectsDeleteAll(0,0,-1);
}
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,const int prev_calculated,const datetime &time[],const double &open[],const double &high[],const double &low[],const double &close[],const long &tick_volume[],const long &volume[],const int &spread[]){

return(rates_total);
}
//+------------------------------------------------------------------+
void OnChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam){
  
  time0 =  ObjectGet("p",OBJPROP_TIME1);   time1 =  ObjectGet("p",OBJPROP_TIME2);
  timeE0 =  ObjectGet("q",OBJPROP_TIME1);  timeE1 = timeE0 + time1-time0;
  ObjectSet("q",OBJPROP_TIME2,timeE1);
  
}
//+------------------------------------------------------------------+
Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Object Types
Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
When a graphical object is created using the ObjectCreate() function, it's necessary to specify the type of object being created, which can be one of the values of the ENUM_OBJECT enumeration. Further specifications of object properties are possible using functions for working with graphical objects.
Files:
Reason: