Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS1058

error An options object { … } can only be the last argument of a call.

#What it means

Arguments given by name go in an options object { name: value, … }, and that object must be the last argument of the call. Here more arguments follow it.

#Typical cause

  • A positional argument after the options object, as in plot(close, { color: color.orange }, "Close").
  • Two options objects in one call.

#How to fix it

Put the positional arguments first and every named one in a single options object at the end: plot(close, "Close", { color: color.orange }). See Functions.

#Example

ChartScriptError: CS1058
//@chartscript 1
indicator("Close", { overlay: true })
plot(close, { color: color.orange }, "Close")

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Close", { overlay: true })
plot(close, "Close", { color: color.orange })
  • CS2007 — The argument param is given twice.
  • CS2006 — name has no parameter named param.

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