Download MetaTrader 5

MT4 New Bar in indicator

To add comments, please log in or register
MQL5.community allows users to store their source codes in MQL5 Storage. Try it!
imamushroom
157
imamushroom 2015.08.05 22:46 

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. 

Alain Verleyen
Moderator
30739
Alain Verleyen 2015.08.06 08:32  

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.
imamushroom
157
imamushroom 2015.08.06 15:37  
I'm using MT4 not MT5 so this isn't relevant I'm afraid. Any other ideas?
Alain Verleyen
Moderator
30739
Alain Verleyen 2015.08.06 21:38  
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 ?

To add comments, please log in or register