Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS1037

error Expected => or a block { … } after the parameter list.

#What it means

After the parameter list of a function or method comes its body: => and an expression, or a block { … }.

#Typical cause

  • Both were left out, as in function f(x) x * 2.
  • -> or = was used instead of =>.

#How to fix it

Write function f(x) { return x * 2 } or const f = (x) => x * 2; for a method, method float.twice() => this * 2. See Functions.

#Example

ChartScriptError: CS1037
//@chartscript 1
indicator("Double")
method float.twice() this * 2
plot(close.twice())

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Double")
method float.twice() => this * 2
plot(close.twice())
  • CS1030 — Expected expected but found found.

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