CS2008
error Expected expected but got got.
#What it means
A value has the wrong type for where it is used. The message gives the type that was needed and the one that was found.
#Typical cause
- A number written as a string, as in
"14". - A string or colour used in arithmetic.
- The two sides of
?:or of anifexpression have types that do not mix. - A function, type or namespace used where a value is needed.
#How to fix it
Give a value of the expected type. Convert explicitly where needed: str.tostring(x) for text, int(x) for a whole number. See Types.
#Example
//@chartscript 1
indicator("SMA", { overlay: true })
plot(ta.sma(close, "14"))Fixed
//@chartscript 1
indicator("SMA", { overlay: true })
plot(ta.sma(close, 14))