CS1020
error Unexpected character char.
#What it means
The script contains a character that has no meaning in ChartScript, outside a string or a comment.
#Typical cause
- A symbol ChartScript does not use, such as
@,#outside a colour, or the single&and|(logic is written&&and||). - A "smart" quote or another look-alike character pasted from a document.
- An invisible character, shown in the message as
U+and its code.
#How to fix it
Delete or replace the character. "And" is &&, "or" is ||, and strings use plain ", ' or ` quotes. See Operators.
#Example
//@chartscript 1
indicator("Up bars")
const up = close > open & volume > 0
plot(up ? 1 : 0)Fixed
//@chartscript 1
indicator("Up bars")
const up = close > open && volume > 0
plot(up ? 1 : 0)#Related
- CS1021 — This string is not closed on the same line.