EA in Tester, using Open Prices Only Model.... -Unexpected results-

 

Hi, working on a new EA idea. This is long term trading, where trades last something  like 50 - 500 bars. Therefore I have no interest in intrabar ticks, even Trailing Stop is

done from bar to bar. And this Ea is slow in processing so testing takes too long in Tick Mode so I want to use OPO mode as it runs about 1000 times faster.

So to get realistic results from forward testing I must mask out all ticks, except the one that brings a new H1 bar with it. Did this this way:

//+------------------------------------------------------------------+ 
int start() 
  {   
  if(  Bars <=PrevBars  ) return(0);//Only Open of new bar is passed thru
  PrevBars = Bars;
  cnt++;//Debug, bar counter
  
  DrawText(IntegerToString(cnt),1);//Debug, Draws NoOf Bars to chart
//+---------- 
 
  //
  //Rest of EA code here
  //

   return(0);//End Of START
  } 
//+------------------------------------------------------------------+


And this works, in the sense that I get the same number of bars (cnt) thru in both Tick and OPO mode, and also CPO mode.

I also get the same number of trades (400) in all cases, but the trade results are widly different, something like 10:1.. Why?

I must (I think) either be getting different H1 bars, or the same correct bar, but with different price.

Documentation on MQL5: Timeseries and Indicators Access / Bars
Documentation on MQL5: Timeseries and Indicators Access / Bars
  • www.mql5.com
Bars - Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: