Please help: IndicatorCounted() function

 
Can someone please explain the IndicatorCounted() function to me in plain english? I have read the limited documentation, but cannot figure it out.

Does it simply count the numbers of bars since the last tick? What is the difference between it and Bars? How is it used in init() and in start()?

I often see the same segment of code repeated, but cannot figure out what it achieves:


int start()
{
int i, limit;
int countedBars = IndicatorCounted();

limit = Bars - countedBars;
for( i = 0; i < limit; i++ )
{.....................................................


Thanks
Des
 
"IndicatorCounted" function allows to perform an economical calculation of an indicator. The function returns the number of bars at the moment of the preceding launch of the indicator. I.e., the number of bars already counted (potentially, if there were no errors or early termination at the preceding launch) which are not to be recalculated. When a custom inidicator is re-initialized or when history data are considerably updated, this number will be zeroed.
Reason: