Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS1001

error The first line must be //@chartscript 1

#What it means

Every ChartScript file must begin with the version header //@chartscript 1 on its very first line. It tells the compiler which version of the language the script is written in.

#Typical cause

  • The header line is missing.
  • Something comes before it: a blank line, a comment or the indicator(...) call.
  • The header is misspelled, for example // @chartscript with a letter missing.

#How to fix it

Put //@chartscript 1 alone on line 1. The editor offers a quick fix that inserts it for you. See Your first script.

#Example

ChartScriptError: CS1001
indicator("Close line", { overlay: true })
plot(close)

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Close line", { overlay: true })
plot(close)
  • CS1002 — ChartScript version version is not known to this compiler (newest: max).
  • CS1003 — The script must start with indicator(...) or library(...) after the header.

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