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
// @chartscriptwith 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
indicator("Close line", { overlay: true })
plot(close)Fixed
//@chartscript 1
indicator("Close line", { overlay: true })
plot(close)