Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS4114

error A script can share at most max what.

#What it means

A script can share up to 32 series, 8 event ids and 8 level ids. The message says which limit was passed. Scripts that link this one depend on what it shares, so the list is kept small.

#Typical cause

  • A separate id for every variant of one thing: nine kinds of bar as nine event ids, or a level id for each session.

#How to fix it

Group them. One event id can carry many kinds of event, told apart by text, side and strength; one level id can hold many levels, told apart by key, name and kind. See Plan slots.

#Example

ChartScriptError: CS4114
//@chartscript 1
indicator("Bar events")
const body = math.abs(close - open)
const range = high - low
const atr = ta.atr(14)
if (close > open) { share.event("up_bar") }
if (close < open) { share.event("down_bar") }
if (high > high[1] && low < low[1]) { share.event("outside_bar") }
if (high < high[1] && low > low[1]) { share.event("inside_bar") }
if (body < range * 0.1) { share.event("doji") }
if (close > high[1]) { share.event("close_above") }
if (close < low[1]) { share.event("close_below") }
if (volume > volume[1] * 2) { share.event("volume_jump") }
if (range > atr * 2) { share.event("wide_bar") }
plot(close)

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Bar events")
const body = math.abs(close - open)
const range = high - low
const atr = ta.atr(14)
if (close != open) { share.event("bar", { side: close > open ? 1 : -1, text: close > open ? "up bar" : "down bar" }) }
if (high > high[1] && low < low[1]) { share.event("bar", { text: "outside bar" }) }
if (high < high[1] && low > low[1]) { share.event("bar", { text: "inside bar" }) }
if (body < range * 0.1) { share.event("bar", { text: "doji" }) }
if (close > high[1]) { share.event("bar", { side: 1, text: "close above" }) }
if (close < low[1]) { share.event("bar", { side: -1, text: "close below" }) }
if (volume > volume[1] * 2) { share.event("bar", { text: "volume jump" }) }
if (range > atr * 2) { share.event("bar", { text: "wide bar" }) }
plot(close)
  • CS4109 — A script can link at most max scripts (this one links got).
  • CS4111 — The share id 'id' is already used for kind; one id has one kind.
  • CS4112 — share.series("id") detail.

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