MT4 New Bar in indicator

 

Hi,

 

Could someone please show me how I detect and only execute something at the beginning of a new bar please.

I know how to do it in an EA but this is the first indicator I've written.

 Thanks in advance. 

 

Please do some search before asking, there is a lot of resource on this site on this subject, for example :

https://www.mql5.com/en/articles/159

The "New Bar" Event Handler
The "New Bar" Event Handler
  • 2010.10.11
  • Konstantin Gruzdev
  • www.mql5.com
MQL5 programming language is capable of solving problems on a brand new level. Even those tasks, that already have such solutions, thanks to object oriented programming can rise to a higher level. In this article we take a specially simple example of checking new bar on a chart, that was transformed into rather powerful and versatile tool. What tool? Find out in this article.
 
I'm using MT4 not MT5 so this isn't relevant I'm afraid. Any other ideas?
 
imamushroom:
I'm using MT4 not MT5 so this isn't relevant I'm afraid. Any other ideas?

It's perfectly relevant.

What is the results of your own researches ?