Download MetaTrader 5

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

To add comments, please log in or register
Develop applications to order. Make profit using Freelance service!
Miroslav Popov
365
Miroslav Popov 2015.06.29 09:14 

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?

Marco vd Heijden
Moderator
4680
Marco vd Heijden 2015.06.29 09:22  

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.

Miroslav Popov
365
Miroslav Popov 2015.06.29 09:24  

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.



Marco vd Heijden
Moderator
4680
Marco vd Heijden 2015.06.29 09:26  
did you download the full history in history center?
Miroslav Popov
365
Miroslav Popov 2015.06.29 09:27  
I never do it. It replaces the data from my broker.
Marco vd Heijden
Moderator
4680
Marco vd Heijden 2015.06.29 09:32  
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.
Miroslav Popov
365
Miroslav Popov 2015.06.29 09:48  

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


Miroslav Popov
365
Miroslav Popov 2015.06.29 10:19  

Same behaviour on EURUSD M15 chart:



M15 ticks

Tester


About

Marco vd Heijden
Moderator
4680
Marco vd Heijden 2015.06.29 11:17  

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.

Alain Verleyen
Moderator
30640
Alain Verleyen 2015.06.29 14:54  
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.
Marco vd Heijden
Moderator
4680
Marco vd Heijden 2015.06.29 17:27  
Yicks i ment missing ticks.
123
To add comments, please log in or register