Send order at closure of the candle

 
count();
      if(condition01==1)
         {
         tick=OrderSend(Symbol(),OP_BUY,lot,Ask,5,0,0,"condition1",magic,0,clrGreen);
         time1=Time[0];
         }

Good morning,

I'm writing an Expert Advisor, but I need to send the order at the closure of the candle and not immediately when the condition meet. There is a  function to do it? Or how I can write it? Can someone please help me? What I wrote it sends the order immediately, but how can I modify it to send it at the closure of the candle?


 
Trader1529:

Good morning,

I'm writing an Expert Advisor, but I need to send the order at the closure of the candle and not immediately when the condition meet. There is a  function to do it? Or how I can write it? Can someone please help me? What I wrote it sends the order immediately, but how can I modify it to send it at the closure of the candle?


Do not Double post.

I have deleted your duplicate topic.

 
Keith Watford:

Do not Double post.

I have deleted your duplicate topic.

Sorry, but I had duplicated it because no one replied on my post.

 
Trader1529: order at the closure of the candle and not immediately when the condition meet.
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 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 programming forum
 
William Roeder:
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 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 programming forum

Thank you

Reason: