RoboForex OnTimer not firing on MT4 - page 2

 
Nguyen Nga:

Hmm!  Interesting indeed - many thanks for that.  As you've seen from my log files, it is certainly not working in my RoboForex environment.  It's on a VPS whose CPU is struggling a bit, so I did wonder if the events were getting queued for too long, but I had it running for over an hour and not a single event was recorded.

I think my next move will be to try it on my local machine rather than the VPS.

Again thanks for your efforts. 

 
Wayside48:

Hmm!  Interesting indeed - many thanks for that.  As you've seen from my log files, it is certainly not working in my RoboForex environment.  It's on a VPS whose CPU is struggling a bit, so I did wonder if the events were getting queued for too long, but I had it running for over an hour and not a single event was recorded.

I think my next move will be to try it on my local machine rather than the VPS.

Again thanks for your efforts. 

Theres always that something that people don't tell up front.

 
Marco vd Heijden:

You havent proven anything why are you using isOptimzed in that piece of code? did you check the 

I stick to my first answers timer function runs locally and is not affected by broker, even in weekends when markets are closed i use ontimer to have the ea run calculations to find next week entries.

I also have ea's where the ontimer generates arteficial ticks those also live without a live market feed.

if you do not find a solution and believe it to be a bug then please write to servicedesk.

Also you should take a simpler route to test things there are too many things in between dropping a simple

In the timer function should be a more direct approach to check if the timer runs, in stead of writing to files and all that.

I do have trading allowed because the EA I'm using to actually trade on the account is working fine.  In any case why would that affect the existence of the OnTimer event?

The "writeToLog()" method is simply one I use everywhere and is well tested and is proved to work in this situation by the fact that the "Initialisation" messages are written.  The IsOptimization() is only there so it doesn't try to write log files during optimization.

I agree - I have used OnTimer all over the place (for several years) and have had no problems with it until now.  I know it's not a "bug" because it works in all but my RoboForex environment.

Anyway, Nguyen Nga has proved that on his RoboForex account it works fine (logging and all!), so it must be related to my environment.  You keep saying that it's "local" - well yes it's a function of the MQL4 framework, but as far as I know there is no reason why RoboForex might not have their own version of the framework which, for some reason, doesn't support the OnTimer event.  To be honest if that were the case I would have expected a respectable programmer to throw a NotImplemented exception in response to the EventSetTime() method, but you never know.

 
Wayside48:

I do have trading allowed because the EA I'm using to actually trade on the account is working fine.  In any case why would that affect the existence of the OnTimer event?

The "writeToLog()" method is simply one I use everywhere and is well tested and is proved to work in this situation by the fact that the "Initialisation" messages are written.  The IsOptimization() is only there so it doesn't try to write log files during optimization.

I agree - I have used OnTimer all over the place (for several years) and have had no problems with it until now.  I know it's not a "bug" because it works in all but my RoboForex environment.

Anyway, Nguyen Nga has proved that on his RoboForex account it works fine (logging and all!), so it must be related to my environment.  You keep saying that it's "local" - well yes it's a function of the MQL4 framework, but as far as I know there is no reason why RoboForex might not have their own version of the framework which, for some reason, doesn't support the OnTimer event.  To be honest if that were the case I would have expected a respectable programmer to throw a NotImplemented exception in response to the EventSetTime() method, but you never know.

i Have no idea what framework you are talking about.

The OnTimer function runs on the local processor clock, there is no way for roboforex, or any broker for that matter to tamper with that.

It's quite simple, and that 's why i stick to:

Marco vd Heijden:

Not possible.

 

Well, I'm afraid what I said is possible.  I was clutching at straws rather with the over loaded CPU suggestion, but it turns out to be the problem.  It seems RoboForex are providing a really poor VPS service.  I have two instances of MT4 terminal running on it and the CPU usage was sitting at 100% more-or-less permanently.

As I said, I left my test EA running for over an hour and not a single OnTimer event got through to it, although OnTick events did get through, though I have no idea how late!

However, I have just tried again today, and the OnTick events are getting through - the difference being that the CPU is only running around 70% occupied due to the lack of trading traffic (no OnTick events!).  Even 70% is completely ridiculous in the circumstances - I have another similar spec'd VPS (single core Intel Xeon at 2GHz with 1G RAM) which with the same single MT4 instance running is consuming barely 1% CPU at the moment, and during the week peaks to around 20%.

So, I don't know whether the OnTick event has greater priority than OnTimer, but it's something to watch if you rely on OnTimer and your CPU is busy!

The end. 

 
Wayside48:

Well, I'm afraid what I said is possible.  I was clutching at straws rather with the over loaded CPU suggestion, but it turns out to be the problem.  It seems RoboForex are providing a really poor VPS service.  I have two instances of MT4 terminal running on it and the CPU usage was sitting at 100% more-or-less permanently.

As I said, I left my test EA running for over an hour and not a single OnTimer event got through to it, although OnTick events did get through, though I have no idea how late!

However, I have just tried again today, and the OnTick events are getting through - the difference being that the CPU is only running around 70% occupied due to the lack of trading traffic (no OnTick events!).  Even 70% is completely ridiculous in the circumstances - I have another similar spec'd VPS (single core Intel Xeon at 2GHz with 1G RAM) which with the same single MT4 instance running is consuming barely 1% CPU at the moment, and during the week peaks to around 20%.

So, I don't know whether the OnTick event has greater priority than OnTimer, but it's something to watch if you rely on OnTimer and your CPU is busy!

The end. 

Why don't you try and benchtest that server to see if it is working properly.

In the piece of code you provided.

EventSetTimer(60);

This can never lead to a 70% CPU load, unless you are stuck in an endless loop.

For example i run my robots,

EventSetMillisecondTimer(200);

Without any problems.