[MQL4 newbie] IndicatorCounted() question, indicator/EA

 

Hi,



I'm developing my first EA. I would like to use an indicator main() function as a custom function in the EA.

In the indicator "int counted_bars=IndicatorCounted();" returns "the amount of bars not changed after the indicator had been launched last" (as writen in this function documentation). Then I have to test each bar.

In an EA is the amount of bars changed after the EA had been launched last always egal to 1, since the EA is launched every ticks ?

I couldn't find an equivalent function for EA, so that's my guess, as I said I'm new to EA development.


Thanks and regards,
Jean Coiron

 
 

Hi Jean, 

Usually calling iCustom on the indicator's few last bars (2,1,0) is sufficient.

But if you must have an IndicatorCounted in your EA, there's an article that suggests an emulation of it. 

 
Thank you this article helped me a lot :)
Reason: