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 afor,iforwhilebefore its{. - A missing comma, or
:=where ChartScript writes=. - A word from another language, such as
andwhere 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
//@chartscript 1
indicator("Sum of closes")
let total = 0.0
for (let i = 0; i <= 10; i++ {
total += close[i]
}
plot(total)Fixed
//@chartscript 1
indicator("Sum of closes")
let total = 0.0
for (let i = 0; i <= 10; i++) {
total += close[i]
}
plot(total)