Download MetaTrader 5
To add comments, please log in or register
What is a social trading? Read the article to find that out!
Webmeiker
11
Webmeiker 2015.08.17 20:11 

Hi, 

I have made my first indicator, but I don't want it to be started again and again at every tick.

Its a "slow" indicator suitable for the 4H period. So for me should be enough if it gets re-started only when a new candle opens, for example, or when the user refresesh the graphic window...

After reading the documentation I didnt find the solution. https://docs.mql4.com/basis/function/events 

This approximation works for me, but I want to know if exists a better way:

extern bool FlagOnlyOneExecution = true;

int start() {          

if (FlagOnlyOneExecution) {

//... do the thing here ...

}

FlagOnlyOneExecution = false;

Could somebody give me advice?
Thanks
whroeder1
13597
whroeder1 2015.08.18 12:01  
Test for a new candle.
/
To add comments, please log in or register