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.
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
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.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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:
This happens for every M5 bar. There is no ticks for the last 25-35 seconds.
This is definitely a bug. Any comments?