Code Base
To post a new code, please log in or register
Interesting script?

So post a link to it -
let others appraise it

Subject: LoongClock [ ru ]
Author: Loong
Downloads: 307
Rating:
votes: 3
Files:
loongclock.mq5 (1.85 KB)view
cloongclock.mqh (11.49 KB)view

Description:

A very simple sample of clock.  You can select GMT, SERVER, or LOCAL time.

input ENUM_TIME_FUNC  inp_tf = TIME_FUNC_LOCAL;
CLoongClock c1;
int OnInit()
  {
   EventSetTimer(1); // 1 second
   c1.SetTimeFunc(inp_tf);
   return(0);
  }
void OnDeinit(const int reason)
  {
   EventKillTimer();
  }
void OnTimer()
  {
   c1.Timer();
   ChartRedraw();
  }

Image:

 

Last comments | Go to discussion (2)
Loong
Loong | 5 Feb 2010 at 14:35
investeo:


Is there any way to run the timer with milisecond intervals?

I don't know.

EventSetTimer() seem can not to accept float value. So 1 second maybe is the best precision.

Maybe you can do something with EventChartCustom() ?

Or make a loop, and get time with GetTickCount()...

investeo
investeo | 5 Feb 2010 at 11:27
Automated-Trading posted  :

LoongClock:

Author: 龙一


Is there any way to run the timer with milisecond intervals?