open only one order by the required candle

 
Please i want to excute only one order by one candle so i use time[0]but it does not work correctly ,best regards.
 
The code was
if time[0]!=time { //excute order//}


 
  1. Ahmed774 i want to excute only one order by one candle so i use time[0]but it does not work correctly ,best regards.
    There are no mind readers here, we can't see your broken code.

  2. Ahmed774: if time[0]!=time { //excute order//}
    Post all the relevant code, we don't know what time is, or wither it is static or global, or wither you ever update it. Next time edit your original post.

  3. For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart,) volume is unreliable (miss ticks,) Price is unreliable (duplicate prices and The == operand. - MQL4 and MetaTrader 4 - MQL4 programming forum.) Always use time.
    I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
              New candle - MQL4 and MetaTrader 4 - MQL4 programming forum

 
The code is
On global side
datetime time;
Void ontick
if Time[0]!=time ; {//open new order}



Reason: