//+------------------------------------------------------------------+
//|                                               Time indicator.mq4 |
//|                            Copyright © 2013, www.FxAutomated.com |
//|                                       http://www.FxAutomated.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2013, www.FxAutomated.com"
#property link      "http://www.FxAutomated.com"

#property indicator_chart_window

extern color BrokerTimeColor=DodgerBlue;
extern color ComputerTimeColor=Red;
extern color DateTimeColor=DarkSlateGray;
extern int   DistanceFromTopLeft=30;
extern double ZoomLevel=0.6;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   
   ObjectCreate("Label_dt", OBJ_LABEL, 0, 0, 0);  // Creating obj.
   ObjectSet("Label_dt", OBJPROP_CORNER, 3);    // Reference corner
   ObjectSet("Label_dt", OBJPROP_XDISTANCE, DistanceFromTopLeft*ZoomLevel);// X coordinate   
   ObjectSet("Label_dt", OBJPROP_YDISTANCE, 130*ZoomLevel);// Y coordinate
   
   
   ObjectCreate("Label_bt", OBJ_LABEL, 0, 0, 0);  // Creating obj.
   ObjectSet("Label_bt", OBJPROP_CORNER, 3);    // Reference corner
   ObjectSet("Label_bt", OBJPROP_XDISTANCE, DistanceFromTopLeft*ZoomLevel);// X coordinate   
   ObjectSet("Label_bt", OBJPROP_YDISTANCE, 30*ZoomLevel);// Y coordinate

   ObjectCreate("Label_ct", OBJ_LABEL, 0, 0, 0);  // Creating obj.
   ObjectSet("Label_ct", OBJPROP_CORNER, 3);    // Reference corner
   ObjectSet("Label_ct", OBJPROP_XDISTANCE, DistanceFromTopLeft*ZoomLevel);// X coordinate   
   ObjectSet("Label_ct", OBJPROP_YDISTANCE, 80*ZoomLevel);// Y coordinate





//----
   return(0);
  }

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
  
//----
   ObjectSetText("Label_bt",TimeToStr(TimeCurrent(),TIME_SECONDS),22*ZoomLevel,"Arial",BrokerTimeColor); //TIME_DATE|
   ObjectSetText("Label_ct",TimeToStr(TimeLocal(),TIME_SECONDS),22*ZoomLevel,"Arial",ComputerTimeColor);//TIME_DATE|
   ObjectSetText("Label_dt",TimeToStr (TimeLocal(),TIME_DATE),20*ZoomLevel,"Arial",DateTimeColor);  
//----
   return(0);
  }
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   ObjectDelete("Label_bt");
   ObjectDelete("Label_ct");
//----
   return(0);
  }