CS2703
error word can only be used inside a loop.
#What it means
break (leave the loop) and continue (skip to the next pass) only make sense inside a for or while loop.
#Typical cause
breakorcontinueinside anifthat is not in a loop.
#How to fix it
Remove it, or restructure the code with if / else. See Loops.
#Example
//@chartscript 1
indicator("Skip")
const value = close
if (close < open) {
break
}
plot(value)Fixed
//@chartscript 1
indicator("Skip")
const value = close < open ? na : close
plot(value)#Related
- CS2702 — A loop over the items of a list needs an array.