MQL4 skip a bar

 

Is it possible to skip a bar after completing a trade.

   if(Bars>LastBar+1)
      {
      LastBar=Bars;
      }
	return;
 
OTC:

Is it possible to skip a bar after completing a trade.

Yes it is, If by skipping you mean limiting the EA's actions.

The way you will want to do it depends on the rest of your program.

Here are some of them:
- static datetime variable which holds the time of the last action; then check if current bar's time is different the the saved time before doing the action
- using iBarShift to find the bar index of your OrderOpenTime(); then check how far that bar is to the current
- bool as a "flag" like you are using in your example to detect a new bar; counting the number of time this "flag" is triggered

etc.

I'm not sure which would be better and/or if there is an official way to do it, but these around some workarounds to start with.