Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS2003

error name is a built-in namespace and cannot be used as a name.

#What it means

This name belongs to a built-in namespace (such as ta, math, color or str), so it cannot be used for your own variable, function or type: that would hide every built-in in it.

#Typical cause

  • A variable named after what it holds, such as ta = ta.sma(close, 14) or color = ....

#How to fix it

Pick another name, such as avg or lineColour. See Built-ins.

#Example

ChartScriptError: CS2003
//@chartscript 1
indicator("Average")
const ta = ta.sma(close, 14)
plot(ta)

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Average")
const avg = ta.sma(close, 14)
plot(avg)
  • CS1027 — name is reserved and cannot be used as a name.
  • CS2001 — name is not defined.

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