Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS1030

error Expected expected but found found.

#What it means

The compiler expected a particular word or symbol at this spot, and found something else. The message says what it expected and what it found.

#Typical cause

  • A missing bracket, such as the ) that closes the head of a for, if or while before its {.
  • A missing comma, or := where ChartScript writes =.
  • A word from another language, such as and where ChartScript writes &&.

#How to fix it

Look at the spot the error points to and add or correct what the message asks for. See Loops for the loop forms.

#Example

ChartScriptError: CS1030
//@chartscript 1
indicator("Sum of closes")
let total = 0.0
for (let i = 0; i <= 10; i++ {
    total += close[i]
}
plot(total)

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Sum of closes")
let total = 0.0
for (let i = 0; i <= 10; i++) {
    total += close[i]
}
plot(total)
  • CS1031 — open is not closed.
  • CS1032 — Expected an expression.
  • CS1033 — Expected the end of the statement.

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