Skip to content
ChartDeck ChartScript docs Account Open the terminal

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 = ....
  • self as a name: inside a method the object is this.
  • undefined: ChartScript writes "no value" as na.

#How to fix it

Choose another name, for example cls, category or strat. See Variables.

#Example

ChartScriptError: CS1027
//@chartscript 1
indicator("Bar class")
const class = close > open ? 1 : -1
plot(class)

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Bar class")
const barClass = close > open ? 1 : -1
plot(barClass)
  • CS2003 — name is a built-in namespace and cannot be used as a name.
  • CS1026 — Names are at most max characters.

The ChartScript documentation is in English for now; translations will follow.