Need to execute the order only on the closing of day candle stick

 

Hi Geeks,

I am very new to this field and want to automate my trading. I want to place my order on the closing (and ofcourse opening of new candle) of day long Candle stick.

The Start() event get called on every tick. Is there any way so that I choose only that tick which comes at the time of closing the candle?

Thanks in Advance!

Kailash Bisht

 

https://www.mql5.com/en/forum/127224

bool Fun_New_Bar()
   {
   static datetime New_Time = 0;
   bool New_Bar = false;
   if (New_Time!= Time[0])
      {
      New_Time = Time[0];
      New_Bar = true;
      }
   return(New_Bar);
   }
 

Thanks a lot. Now I have got the solution.

It works. :-)

Reason: