CS2001
error name is not defined.
#What it means
The script uses a name that was never declared and is not a built-in.
#Typical cause
- A typo, such as
closeeforclose. - A variable used before the line that declares it.
- A variable declared inside a block (an
if, a loop or a function) and used outside it.
#How to fix it
Check the spelling (the editor often suggests the closest name) and declare variables before you use them, in a block that contains every use. See Variables.
#Example
//@chartscript 1
indicator("SMA", { overlay: true })
plot(ta.sma(closee, 14))Fixed
//@chartscript 1
indicator("SMA", { overlay: true })
plot(ta.sma(close, 14))