CS2711
error The argument param of name must be a constant.
#What it means
Settings statements are read when the script is compiled, before any bar exists, so this argument must be a constant such as a literal string or number.
#Typical cause
- A title, id or name built from a variable or a bar value.
#How to fix it
Write the value directly as a literal.
#Example
//@chartscript 1
indicator("Sections")
const name = "Trend " + str.tostring(bar_index)
settings.section("main", name)
const len = input.int(14, "Length")
plot(ta.sma(close, len))Fixed
//@chartscript 1
indicator("Sections")
settings.section("main", "Trend")
const len = input.int(14, "Length")
plot(ta.sma(close, len))