Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS2104

error The argument param of name must be a constant or an input.

#What it means

This argument must be a constant or an input: something that stays fixed for the whole run. The value you passed can change from bar to bar.

#Typical cause

  • A bar value or a calculation on bars passed where a fixed value is needed, for example the price of hline.

#How to fix it

Pass a constant or an input. For a level that moves with the bars, draw it with plot instead of hline. See Levels.

#Example

ChartScriptError: CS2104
//@chartscript 1
indicator("Level")
const level = ta.sma(close, 50)
hline(level)
plot(close)

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Level")
const level = input.float(100.0, "Level")
hline(level)
plot(close)
  • CS2103 — The argument param of name must be a constant.
  • CS2101 — The argument param of name must be the same on every bar (needed), but this value is got.

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