Download MetaTrader 5

OnTimer

To add comments, please log in or register
hornsALERT
62
hornsALERT  
How can you force an EA to run only OnTimer in mql4 and ignore any incoming broker ticks?
Ex Ovo Omnia
3185
Ex Ovo Omnia  
BHC:
How can you force an EA to run only OnTimer in mql4 and ignore any incoming broker ticks?

Probably by renaming the start() to OnTimer()
Alain Verleyen
Moderator
31184
Alain Verleyen  
BHC:
How can you force an EA to run only OnTimer in mql4 and ignore any incoming broker ticks?

Don't use a start() or OnTick() function, or do this :

void OnTick()
  {
   return;
  }
jirouda1
24
jirouda1  
angevoyageur:

Don't use a start() or OnTick() function, or do this :


I made this code for testing but OnTimer dont work, with OnTick is ale rigt. Would be the problem that broker doesnt support this function?


<CODE REMOVED>

Simon Gniadkowski
Moderator
18003
Simon Gniadkowski  
cza:

I made this code for testing but OnTimer dont work, with OnTick is ale rigt. Would be the problem that broker doesnt support this function?


<CODE REMOVED>

I removed your code . . . .


Please edit your post above and re-insert your code using the SRC button . . . please use the SRC button to post code: How to use the SRC button.

To edit your post . . .

jirouda1
24
jirouda1  
RaptorUK:

I removed your code . . . .


Please edit your post above and re-insert your code using the SRC button . . . please use the SRC button to post code: How to use the SRC button.

To edit your post . . .




ok, but you could connect some answer for my question too :))
Alain Verleyen
Moderator
31184
Alain Verleyen  
cza:

ok, but you could connect some answer for my question too :))
Of course, please post your code.
Simon Gniadkowski
Moderator
18003
Simon Gniadkowski  
cza:

ok, but you could connect some answer for my question too :))
OK ? so do as I asked . . . and I'll look at helping.
darksideofthemoon
57
darksideofthemoon  
cza:

I made this code for testing but OnTimer dont work


What? You sure use build 600? This surely runs on my box:


// expert - testtimer

#property strict

int OnInit()
{
        EventSetTimer(1);
        return(INIT_SUCCEEDED);
}
void OnDeinit(const int reason)
{
        EventKillTimer();
}
void OnTimer()
{
        Print("happy timer, tick, tick...");
}
To add comments, please log in or register