Download MetaTrader 5

Indicator re-started NOT on every tick

To add comments, please log in or register
Webmeiker 2015.08.17 20:11 


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. 

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?
whroeder1 2015.08.18 12:01  
Test for a new candle.
To add comments, please log in or register