help..once per bar

 

hi

I am working on an EA that work with renko chart.....i want open just one trade per bar

using bar time will not work with me because in renko charts may be more 1 bar have same time!

datetime BarTime1 = 0;
 
int start()
{
 
  if (BarTime1 != Time[0])
  {
    //My code
     
    BarTime1 = Time[0];
  }
 
  return(0);
}
 
ali333: will not work with me because in renko charts may be more 1 bar have same time!
Fix the generator. They shouldn't have the same time.
 

what do you mean?

my code work good with normal charts......but with renko charts no

 
ali333: what do you mean?
What do you mean "what do you mean"? Mq4 does NOT have renko charts. Therefor your chart comes from a generator. FIX the GENERATOR. It shouldn't be making bars with identical timestamps.
Reason: