CS2014
error value is not one of the allowed values: options.
#What it means
The argument has to be one of a fixed set of values, and this one is not in the set. The message lists the allowed values.
#Typical cause
- An input's default value that is not among its own
options. - A setting such as a language code, a
sectionid or a duration written in the wrong form.
#How to fix it
Use one of the listed values. For an input, either add the default to options or change the default. See Inputs.
#Example
//@chartscript 1
indicator("Average", { overlay: true })
const kind = input.string("SMA", "Average", { options: ["EMA", "WMA"] })
const ema = ta.ema(close, 20)
const wma = ta.wma(close, 20)
plot(kind == "EMA" ? ema : wma)Fixed
//@chartscript 1
indicator("Average", { overlay: true })
const kind = input.string("EMA", "Average", { options: ["EMA", "WMA"] })
const ema = ta.ema(close, 20)
const wma = ta.wma(close, 20)
plot(kind == "EMA" ? ema : wma)