Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS2716

error The preset preset gives name the value value, which the input does not allow.

#What it means

A preset gives an input a value the input itself would not accept: outside its minval / maxval, not in its options, or of the wrong type.

#Typical cause

  • A preset written before the input's limits were tightened.

#How to fix it

Change the preset value to one the input allows, or widen the input's limits.

#Example

ChartScriptError: CS2716
//@chartscript 1
indicator("Presets")
const len = input.int(14, "Length", { minval: 2, maxval: 200 })
settings.preset("Fast", { len: 1 })
plot(ta.sma(close, len))

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Presets")
const len = input.int(14, "Length", { minval: 2, maxval: 200 })
settings.preset("Fast", { len: 5 })
plot(ta.sma(close, len))
  • CS2715 — The preset preset names name, which is not an input of this script.
  • CS2014 — value is not one of the allowed values: options.

The ChartScript documentation is in English for now; translations will follow.