Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS1031

error open is not closed.

#What it means

A bracket was opened but the line (and the expression) ended before it was closed.

#Typical cause

  • A missing ) at the end of a call, often after nested calls.
  • A missing ] after a history offset or a list.

#How to fix it

Add the closing bracket. Counting brackets from the left helps with nested calls such as plot(ta.sma(close, 14)).

#Example

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

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("SMA", { overlay: true })
plot(ta.sma(close, 14))
  • CS1030 — Expected expected but found found.

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