comparing Price to next bar open (or close)

 

How do I compare an order's open price to the next bar and the next? open or close or top or bottom?

no matter what the time intervals.... 1min 5min 15min etc...

Is there a "check price on bar open" function?

When I compare now it compares to the current bar..

I want to compare it to the next several bars' open/close and/or top/bottom.

Thanks for everyone's help... I'm having fun learning how to do all this stuff.

 

See See https://www.mql5.com/en/forum/132294

Read https://book.mql4.com// the Book

Handle new bar with

int start()
  {
  static datetime LastBarTime ;
  if (LastBarTime != Time[0])
   {
    LastBarTime = Time[0] ;
    //process new open Bar
   }
   return(0);
  } 
Reason: