Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS2004

error name has no member member.

#What it means

The name before the dot exists, but it has nothing with the name after the dot. That may be a namespace without that function, a type without that field, or an enum without that item.

#Typical cause

  • A typo in a built-in name, such as ta.smaa.
  • A field that the type does not declare.
  • A function from another charting language that ChartScript names differently.

#How to fix it

Check the spelling in the reference. The editor's completion lists every member of a namespace when you type the dot.

#Example

ChartScriptError: CS2004
//@chartscript 1
indicator("SMA", { overlay: true })
plot(ta.smaa(close, 14))

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("SMA", { overlay: true })
plot(ta.sma(close, 14))
  • CS2001 — name is not defined.
  • CS4006 — name is not exported by path.

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