CS1027
error name is reserved and cannot be used as a name.
#What it means
This word is reserved and cannot name a variable, function, parameter, type or field. Some reserved words (such as class or strategy) are held for future versions of ChartScript, others (var, undefined, self …) would only be confusing, and names starting with $ are kept for the compiler.
#Typical cause
- Using a keyword or a reserved word as a name, for example
const class = .... selfas a name: inside a method the object isthis.undefined: ChartScript writes "no value" asna.
#How to fix it
Choose another name, for example cls, category or strat. See Variables.
#Example
//@chartscript 1
indicator("Bar class")
const class = close > open ? 1 : -1
plot(class)Fixed
//@chartscript 1
indicator("Bar class")
const barClass = close > open ? 1 : -1
plot(barClass)