Tester > Execution types

 

Hello,

I've a problem to understand the deep process of the execution types...

Today I've a system based on bid and ask movements - with no indicators - updated at each tick. When I use tester optimisation, I've very stable trading system with 1mnOHLC solution. But if I use every tick or open execution type, on a 1mn timeframe, I've bad results. I don't understand the meaning of this situation and, of course, the system has bad result in realtime paper trading. To highlight the situation, I precise that it is not a scalping system but a TP/SL 200/200 system.

My questions :

1 -  Does 1mnOHLC significant ? How does it use ? Why do I have very stable results in this situation ?? How can I modify trading system to approach in realtime the same result ??

2 -  What can I have (very) different results in M1 timeframe with these different execution types ?!?

3 - In particular, how can I have very different result when I compare 1mnOHLC/Open execution with M1 timeframe ?!? In both reports, I've the same number of tick bar...  

If you can highlight me... 

 

So, any answers ? My questions are too naives ? Too complex !?!

 
Troub:

So, any answers ? My questions are too naives ? Too complex !?!

Hi

try placing your orders only on the formation of a new bar... and not on tick.

 

Thank you.

I don't know how to do this, but I try... 

 
Troub:

Thank you.

I don't know how to do this, but I try... 

//+------------------------------------------------------------------+
//| Return true if a new bar appears for the symbol/period pair      |
//+------------------------------------------------------------------+
bool isNewBar()
  {
//--- remember the time of opening of the last bar in the static variable
   static datetime last_time=0;
//--- current time
   datetime lastbar_time=SeriesInfoInteger(Symbol(),Period(),SERIES_LASTBAR_DATE);

//--- if it is the first call of the function
   if(last_time==0)
     {
      //--- set time and exit
      last_time=lastbar_time;
      return(false);
     }

//--- if the time is different
   if(last_time!=lastbar_time)
     {
      //--- memorize time and return true
      last_time=lastbar_time;
      return(true);
     }
//--- if we pass to this line then the bar is not new, return false
   return(false);
  }

This is how you do it. 

The above code was copied from https://www.mql5.com/en/articles/22#check_new_bar 

Limitations and Verifications in Expert Advisors
  • 2010.08.03
  • MetaQuotes Software Corp.
  • www.mql5.com
Is it allowed to trade this symbol on Monday? Is there enough money to open position? How big is the loss if Stop Loss triggers? How to limit the number of pending orders? Was the trade operation executed at the current bar or at the previous one? If a trade robot cannot perform this kind of verifications, then any trade strategy can turn into a losing one. This article shows the examples of verifications that are useful in any Expert Advisor.
Reason: