Navigation:Home > Content >

b-clock-tick-and-timer.mq4

Time: 2014-04-09 | Download file:b-clock-tick-and-timer.mq4

/*
   Generated by ex4-to-mq4 decompiler FREEWARE 4.0.451.7
   Website:  h T tP:/ /wWw. Met aq UO T E S .n e T
   E-mail :  s UpPOrT @m E ta Q Uo Te s.Net
*/
#property copyright "Copyright © 2005, Nick Bilak"
#property link      "http://metatrader.50webs.com/"

#property indicator_chart_window

extern color ClockColor = Aqua;
extern int size = 16;

double Gda_unused_84[];

// 52D46093050F38C27267BCE42543EF60
int deinit() {
   ObjectDelete("time");
   EventKillTimer();
   return (0);
}

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   EventSetTimer(1);
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   ShowMeTime();   
   return (0);
}

void OnTimer()
{
  if (MarketInfo(Symbol(),MODE_TRADEALLOWED)) ShowMeTime();
}

void ShowMeTime()
{

   int Li_0 = Time[0] + 60 * Period() - TimeCurrent();
   double Ld_4 = Li_0 / 60.0;
   int Li_12 = Li_0 % 60;
   Li_0 = (Li_0 - Li_0 % 60) / 60;
   Comment(Li_0 + " minutes " + Li_12 + " seconds left to bar end");
   if (ObjectFind("time") != 0) {
      ObjectCreate("time", OBJ_TEXT, 0, Time[0], Close[0] + 0.0005);
   } else ObjectMove("time", 0, Time[0], Close[0] + 0.0005);
   ObjectSetText("time", "                  <" + Li_0 + ":" + Li_12, size, "Arial", ClockColor);
}

Recommend