How to detect a new bar - page 4

 

I didn't find some info about it!

thanks all!! :)
 
Hennie Reyneke:
Sadly this does not seem to work in MQL5.
bool isNewBar()
{
   if(iVolume(Symbol(), 0, 0) <= 1)
      return true;
   else
      return false;
}


Happy day :)

 
Your solution will assume, you get called before there is volume (real volume). I am not sure, but would assume, your code is not working reliable.

There have been so many explanations on how to do it correctly, why give such a flawed example?
 
hesammousavi #: Happy day :)

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.

Reason: