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
//@chartscript 1
indicator("Double")
method float.twice() this * 2
plot(close.twice())Fixed
//@chartscript 1
indicator("Double")
method float.twice() => this * 2
plot(close.twice())#Related
- CS1030 — Expected expected but found found.