CS3005
error max_bars_back must be between min and max.
#What it means
max_bars_back sets how many past bars a series keeps for history (x[n]). It must be a whole number between the two limits in the message: 1 and 10,000. The same limit applies to a constant history offset.
#Typical cause
max_bars_backset above 10,000, below 1 or to a fraction.- A constant offset larger than 10,000, as in
close[20000].
#How to fix it
Use a value from 1 to 10,000. If you need statistics over a very long window, keep a running sum or an array instead of reading far back. See Limits.
#Example
//@chartscript 1
indicator("Long look-back", { max_bars_back: 20000 })
plot(close - close[5000])Fixed
//@chartscript 1
indicator("Long look-back", { max_bars_back: 6000 })
plot(close - close[5000])