"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.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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