unmatched data error

 

Hello everybody,


I'am a Beginner and i was using a tutorial to create my first "own" EA. It's a simple EA which use 2 Moving Averages. 

I did a few Backtests and all was fine. But now i have this Problem (Nothing in the EA has changed!)


To make sure the EA doesn't open hundrets of orders, i used this:

if(timestamp == iTime(Symbol(),Timeframe,0)) return;
  timestamp = iTime(Symbol(),Timeframe,0);

Are there alternatives?


Best greetings


Thank you very much!

 

Blancomi: But now i have this Problem … Are there alternatives?

  1. What problem? You don't state one. Unmatched data means MT4 doesn't have complete lower timeframes history for the test. Don't trust the results.

  2. Instead of iTime you could just use Time[] assuming you want the current chart's timeframe. For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart,) volume is unreliable (miss ticks,) Price is unreliable (duplicate prices and The == operand. - MQL4 and MetaTrader 4 - MQL4 programming forum.) Always use time.
    I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
              New candle - MQL4 and MetaTrader 4 - MQL4 programming forum

 

thank you!


my Problem is the unmatched data error. How to fix it?


I've deleted the data history and got a new one with "F2" 

But i still have the data error

Reason: