Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS2005

error name takes expected arguments, not got.

#What it means

The function was called with the wrong number of arguments. The message says how many it takes and how many it got.

#Typical cause

  • A required argument is missing, such as the length of ta.sma.
  • Too many arguments were given.

#How to fix it

Check the function's signature in the reference (or hover its name in the editor) and pass every required argument.

#Example

ChartScriptError: CS2005
//@chartscript 1
indicator("SMA", { overlay: true })
plot(ta.sma(close))

Fixed

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

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