Discussion of article ""New Bar" Event Handler" - page 4

 

I wanted to thank the author of the class, recently I decided to remove the lines of code that used to identify a new bar and added the class of this article, the speed of my EAs increased by 30% in the period, in addition to reducing errors. Thank you very much. I have no words to thank.

 

I'd like to thank the author of the class, I recently decided to remove the lines of code I was using to identify a new bar and added the class in this article, the speed of my

EAs has increased by 30% in optimisations, as well as reducing errors. Thank you very much. I can't thank you enough.

 

Guys, what folder do I put handler.mqh in?

 
Bruno Assiso:

Guys, what folder do I put handler.mqh in?


include

 
Thank you very much, you've helped me a lot with my EA.
 
It won't work on renko, bar times are often the same there, especially with increased brick size.
 
Great stuff! I had to come back here after experiencing some difficulties with isNewBar in practice...
Congratulations!
 

May I request to know how is the following simple approach?

bool isNewBar() { 
   static long lastBarCount = -1;
   long currentBarCount =  Bars(Symbol(), 0);
   if(lastBarCount != currentBarCount) {
      lastBarCount = currentBarCount;
      return true;
   } else {
      return false;
   }
}
 
Excellent solution! Congratulations! Thank you very much!
 

Currently, my EA opens several orders on the same candle. I think the material in this article would help me.

How do I implement it?