Show_your_local_time

Author: Copyright � 2005, Interbankfx
Show_your_local_time
0 Views
0 Downloads
0 Favorites
Show_your_local_time
//+------------------------------------------------------------------+
//|                                         Show_your_local_time.mq4 |
//|                                    Copyright © 2005, Interbankfx |
//|                                      http://www.interbankfx.com/ |
//+------------------------------------------------------------------+
// Our version 4 platform is GMT + 2. 
// Our version 3 platform is GMT + 3. 

#property copyright "Copyright © 2005, Interbankfx"
#property link      "http://www.interbankfx.com/"

extern int Hours_from_GMT = 5;

int deinit(){
   Comment("");
   if (ObjectFind("lbl_time") > -1){
      ObjectDelete("lbl_time");
   }
}

int init(){
   ShowTime();
   return(0);
}

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start(){
   ShowTime();
   return(0);
}

void ShowTime(){
   int hours = Hour() - Hours_from_GMT - 2;
   string strmin = Minute() + "";
   if (StringLen(strmin) == 1)
      strmin = "0" + strmin;
   string txt = hours + ":" + strmin;
   //Comment(txt);
   
   ObjectCreate("lbl_time", OBJ_LABEL, 0, 0, 0);
   ObjectSet("lbl_time", OBJPROP_XDISTANCE, 10);
   ObjectSet("lbl_time", OBJPROP_YDISTANCE, 15);
   
   ObjectSetText("lbl_time", txt, 16, "Arial", Yellow);
   //ObjectMove("lbl_time", 0, Time[50], High[50]);
}
//+------------------------------------------------------------------+

Comments