MT4 Strategy Tester doesn't generate ticks near to the end of M5 bars

 

MT4 Strategy Tester generates ticks on a M5 chart every 2-3 seconds, but not at the end of the bar.

Expert:

   void OnTick()
     {
      if(Volume[0] == 1) Print("======================================");
      string time = TimeToString(TimeCurrent(), TIME_DATE|TIME_MINUTES|TIME_SECONDS);
      string bid = DoubleToString(Bid,_Digits);
      string ask = DoubleToString(Ask,_Digits);
      Print("TimeCurrent: ", time, ", Bid: ", bid, ", Ask: ", ask);
     }

Result:

Ticks Log

This happens for every M5 bar. There is no ticks for the last 25-35 seconds.

This is definitely a bug. Any comments?

 

i am not sure but when the print command is triggered too many times too fast it will inject a 30 sec timeout where nothing will be print maybe you try to slow down simulation speed.

or put in a

Sleep(X);

after each print line.


Edit after seeing the time print i looks like it is indeed a bug.

 

It is slowed and I'm tracking the print lines visually. I noticed this bug when users of my product reported an issue with the backtester.

This issue appeared recently. It works fine in MT5.



 
did you download the full history in history center?
 
I never do it. It replaces the data from my broker.
 
well are all of your clients using the same broker of is there a difference and if so does it show on all terminals broker independent then it could very well be an MT4 issue.
 

I modified the expert to print only the last tick info from the previous bar.

string previousRecord = "";

void OnTick()
  {
   string time = TimeToString(TimeCurrent(), TIME_DATE|TIME_MINUTES|TIME_SECONDS);
   string bid = DoubleToString(Bid,_Digits);
   string ask = DoubleToString(Ask,_Digits);
   if(Volume[0] == 1)
      Print(previousRecord);
   previousRecord = "TimeCurrent: " + time + ", Bid: " + bid + ", Ask: " + ask;
  }


The interesting is that the last tick for an M5 chart is either at xx:24 or xx:35 with one exception for 20:04:23

Last tick info


 

Same behaviour on EURUSD M15 chart:



M15 ticks

Tester


About

 

yes well timecurrent() returns the last known servertime therefore it should be considered a brokker server issue, at least that's what i can make of it.

you can check in history center if these missing bars actually exist or not.

 
Marco vd Heijden:

yes well timecurrent() returns the last known servertime therefore it should be considered a brokker server issue, at least that's what i can make of it.

you can check in history center if these missing bars actually exist or not.

I think you missed the point. There is no missing bars, but the problem is how ticks are emulated with the Strategy Tester. Seems no tick are generated in the last 25 seconds of a bar.
 
Yicks i ment missing ticks.
Reason: