CS2712
error This is not a settings condition: use inputs, constants, timeframe.in_seconds(), timeframe.period and market.kind with logic, comparisons, + - * / and ?: (detail).
#What it means
Conditions such as visible_if, enabled_if and validate are worked out in the settings panel, without running the script. They may only use inputs, constants, timeframe.in_seconds(), timeframe.period, timeframe.isintraday, market.kind and chart.theme, combined with &&, ||, !, comparisons, + - * / and ?:. The part in brackets at the end of the message is what was not allowed.
#Typical cause
- Bar values such as
closein a settings condition. - Other built-ins, such as
timeframe.multiplierormarket.tick, or function calls.
#How to fix it
Rewrite the condition with the allowed pieces, for example timeframe.in_seconds() > 60 instead of timeframe.multiplier > 1. See Inputs.
#Example
//@chartscript 1
indicator("Smoothing")
const len = input.int(14, "Length", { visible_if: timeframe.multiplier > 1 })
plot(ta.sma(close, len))Fixed
//@chartscript 1
indicator("Smoothing")
const len = input.int(14, "Length", { visible_if: timeframe.in_seconds() > 60 })
plot(ta.sma(close, len))