Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS5121

error A heatmap column can have at most max rows (this one has got).

#What it means

One heatmap column can have at most 2,000 rows: the values array of hm.column (or a heatmap.column's values) had more elements than that.

#Typical cause

  • A price step that is too small for the range it covers, such as a tick-sized step over a whole day's range.

#How to fix it

Use a larger step (the range divided by the rows you want), or split the range into the part you want to see. See Heatmaps.

#Example

ChartScriptOpen in editor
//@chartscript 1
indicator("A tall column", { overlay: true })
state hm = heatmap.new()
hm.column(time, low, market.tick, array.new_float(5000, 1.0))

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Rows that fit", { overlay: true })
state hm = heatmap.new()
const rows = 100
hm.column(time, low, (high - low) / rows, array.new_float(rows, 1.0))
  • CS5120 — A script's heatmaps can hold at most max cells: clear old columns (heatmap.clear) or add fewer rows.

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