Download MetaTrader 5

OnTimer

To add comments, please log in or register
How to test a program before buying?
hornsALERT
62
hornsALERT 2014.02.05 12:39 
How can you force an EA to run only OnTimer in mql4 and ignore any incoming broker ticks?
Ovo Cz
2958
Ovo Cz 2014.02.05 12:49  
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
28535
Alain Verleyen 2014.02.05 13:54  
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 2014.02.05 18:37  
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
17963
Simon Gniadkowski 2014.02.05 18:44  
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 2014.02.05 19:16  
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
28535
Alain Verleyen 2014.02.05 19:28  
cza:

ok, but you could connect some answer for my question too :))
Of course, please post your code.
Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.02.05 21:10  
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 2014.02.05 21:36  
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