Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS1021

error This string is not closed on the same line.

#What it means

A string started with a quote but the line ended before the matching closing quote.

#Typical cause

  • A missing closing quote.
  • Opening with " and closing with ', or the other way round.
  • A string meant to span several lines. "..." and '...' stay on one line; use a template literal (`...`) for text over several lines.

#How to fix it

Close the string on the same line with the same quote it opened with. See Strings and formatting.

#Example

ChartScriptError: CS1021
//@chartscript 1
indicator("Label text")
const title = "Daily high
plot(high, title)

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Label text")
plot(high, "Daily high")
  • CS1022 — Unknown escape sequence esc.
  • CS1023 — This string is longer than max characters.

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