CS2714
error A check must be a bool, but this is got.
#What it means
A check (settings.validate, or the validate argument of an input) must be a bool condition: true when the settings are fine.
#Typical cause
- An input or a number passed on its own, as in
settings.validate(len, ...).
#How to fix it
Write a comparison, such as len >= 2.
#Example
//@chartscript 1
indicator("Checked length")
const len = input.int(14, "Length")
settings.validate(len, "Length must be set")
plot(ta.sma(close, len))Fixed
//@chartscript 1
indicator("Checked length")
const len = input.int(14, "Length")
settings.validate(len >= 2, "Length must be at least 2")
plot(ta.sma(close, len))