News Room


For Indicators:

static datetime pastime = time[0];
if(pastime!=time[0]) {
   Print("new bar closed");

For EA :Example for birth of a new bar in 1minute

datetime lastBarTime=0;

void OnNewBar() {

   if (lastBarTime != iTime(NULL, PERIOD_M1, 0)) {


      lastBarTime = iTime(NULL, PERIOD_M1, 0);



add OnNewBar() function to OnTick() or OnTimer() to detect the birth of a new bar


Source link

Leave a Reply

Your email address will not be published. Required fields are marked *