Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS1026

error Names are at most max characters.

#What it means

A name (of a variable, function, type or field) is longer than the limit given in the message, currently 64 characters.

#Typical cause

  • A very descriptive name that grew too long.
  • Generated or pasted code with long names.

#How to fix it

Shorten the name. A short name and a comment above it usually read better than a very long name.

#Example

ChartScriptError: CS1026
//@chartscript 1
indicator("Names")
const average_of_the_closing_prices_over_the_last_twenty_bars_on_this_chart = ta.sma(close, 20)
plot(average_of_the_closing_prices_over_the_last_twenty_bars_on_this_chart)

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Names")
// average close over the last 20 bars
const avgClose20 = ta.sma(close, 20)
plot(avgClose20)
  • CS1027 — name is reserved and cannot be used as a name.

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