Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS2007

error The argument param is given twice.

#What it means

The same parameter received two values: once by position and once by name, or by name twice.

#Typical cause

  • A value given by position already fills a parameter that is also named later, as in plot(close, "A", { title: "B" }).
  • The same key twice in one options object.

#How to fix it

Give each parameter one value. Remove the duplicate, or give the values by name in the options object so each one is clear.

#Example

ChartScriptError: CS2007
//@chartscript 1
indicator("Close", { overlay: true })
plot(close, "Close", { title: "Last price" })

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Close", { overlay: true })
plot(close, { title: "Last price" })
  • CS1035 — Positional arguments must come before named arguments.
  • CS2006 — name has no parameter named param.

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