CS2103
error The argument param of name must be a constant.
#What it means
This argument must be a constant: a value the compiler can work out from the script text alone, such as a literal or an expression of literals. Inputs and bar values are not allowed here.
#Typical cause
- An input or a variable passed where the compiler needs a fixed value, for example as the title of
alert.on. - An input or a variable as the
calc_bars_countofrequest.tf,request.market,request.lower_tforrequest.market_lower_tf(the depth of a request is fixed when the script compiles: write the number, up to 20,000). - An
optionslist that contains non-constant values.
#How to fix it
Write the value directly in the code (a literal, or a const variable). See Series and qualifiers.
#Example
//@chartscript 1
indicator("Alert")
const title = input.string("Up bar", "Alert title")
alert.on(close > open, title)
plot(close)Fixed
//@chartscript 1
indicator("Alert")
alert.on(close > open, "Up bar")
plot(close)