how to force entry consideration on next bar?

 

hi all

i am using ontick and with some rules to enter trade

 however, when price move too fast, it might trigger 2 or more entries on a single bar

how can i code it so that once it has opened a trade on current bar, it can only open the next trade on next bar onwards?

 thanks 

 
anyone?
 
put it in the beginning of the ontick
if (timee==Time[0]) return;
timee=Time[0];
 

bool BarUnused=true;
.
.
.
void OnTick(void)
      if(CopyRates(_Symbol,_Period,0,1,rates)!=1)
         {Print("CopyRates of ",_Symbol," failed, no history"); return;}  

      if(BarUnused)    // Only one action per bar

        {
        .... your stuff ...
        BarUnused = false;
        }

//--- this code only with the first tick in a bar
      if(rates[0].tick_volume > 1)    return;  

      BarUnused = true;

 
thanks all. will try