CS2101
error The argument param of name must be the same on every bar (needed), but this value is got.
#What it means
This argument must keep the same value on every bar (the message says which qualifier is needed, usually simple), but the value you passed can change from bar to bar (series).
#Typical cause
- A length that depends on the bar, such as
close > open ? 10 : 20, passed to a function whose length must be fixed (for exampleta.rsi). - A request's market or timeframe computed per bar while
dynamic_requests: false.
#How to fix it
Pass a constant, an input, or a value computed only from them. If the value really has to change per bar, use a function that accepts a changing length (ta.sma, ta.ema, ta.highest and a few others do). See Series and qualifiers.
#Example
//@chartscript 1
indicator("RSI")
const len = close > open ? 10 : 20
plot(ta.rsi(close, len))Fixed
//@chartscript 1
indicator("RSI")
const len = input.int(14, "Length", { minval: 1 })
plot(ta.rsi(close, len))