EventSetTimer

 

Hello everyone,

EventSetTimer() appears to work the same sleep(). Is this correct or, can the program still in EventSetTime() run code while the time is set for a period set OnInit()?

 

EventSetTimer(x) sets the timing interval in seconds, EventSetMillisecondTimer(x) set's the interval in milliseconds.

They have got nothing to do with Sleep(x).

I am not sure what you mean by "can the program still in EventSetTimer() run code while the time is set for a period set OnInit()".

It's used to specify the interval not to run code in it... the code is run in OnTimer(){ //Here }

 
Marco vd Heijden:

EventSetTimer(x) sets the timing interval in seconds, EventSetMillisecondTimer(x) set's the interval in milliseconds.

They have got nothing to do with Sleep(x).

I am not sure what you mean by "can the program still in EventSetTimer() run code while the time is set for a period set OnInit()".

It's used to specify the interval not to run code in it... the code is run in OnTimer(){ //Here }

Hello again,

I would like to use it like a watch dog interrupt. Say run main code for 10 minutes, after the time has expired check all pairs in the watch window "Price, spread, rsi, money flow, stochastic, macd".

This will loop until indicators show a good point to start a buy, sell order.

 
 

Hello again,

Sorry sir, I didn't read the reference manual carefully.

I did this:

void OnTimer()
  {
   EventSetTimer(WDT);
   Band_RSI();
   WatchWindow();
  }

Thanks for the reminder to check myself first.