Page 1 of 1

BarCount Indicator and boundaries for new template

Posted: Mon Jan 16, 2023 4:39 pm
by tomz
I am creating an indicator for a template. I need to begin a calculation after a certain number of bars from the beginning of the data series (daily close) and then reset the bar count after certain conditions are met.

I am getting an error code from this script:
Bar:= BarCount+1;

Error code CS0103 The name 'BARCOUNT' does not exist in the current context.

I have a template to show historical data for a single stock and the column with Barcount displays the correct info. Can someone explain why I get an error when I use it within an indicator and if there's a different indicator or script I can use.

I have modified existing templates to build custom ones. I noticed that if I add additional columns to the right of the last column with data the indicators I've added don't calculate. If I add columns to the left of the rightmost column the indicators I've added work correctly. Is this a quirk of ER?

Re: BarCount Indicator and boundaries for new template

Posted: Tue Jan 17, 2023 5:48 am
by tomz
I found that I misspelled the indicator. It should be BarsCount not Barcount. When I run Bar:= BarCount(C)+1 I don't get an error.

Please address second question re added columns.