Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS4111

error The share id 'id' is already used for kind; one id has one kind.

#What it means

A share id names one kind of value: a series, an event set or a level set. The linking script reads each kind in its own way (h.<id>, h.events.<id>, h.levels.<id>), so one id cannot be two kinds. The same holds for the ids in the needs of input.script.

#Typical cause

  • The same id given to share.series and to share.event or share.level.
  • One id listed under two kinds in needs.

#How to fix it

Give each kind its own id, for example pivot_avg for the series and pivot for the event. See Linking scripts.

#Example

ChartScriptError: CS4111
//@chartscript 1
indicator("Shares")
share.series("pivot", ta.ema(close, 21))
const ph = ta.pivothigh(high, 5, 5)
if (!na(ph)) {
    share.event("pivot", { price: ph, side: -1, back: 5 })
}
plot(close)

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Shares")
share.series("pivot_avg", ta.ema(close, 21))
const ph = ta.pivothigh(high, 5, 5)
if (!na(ph)) {
    share.event("pivot", { price: ph, side: -1, back: 5 })
}
plot(close)
  • CS4116 — 'id' cannot be a share id: reason.
  • CS4112 — share.series("id") detail.
  • CS4104 — script does not share what called 'id'. It shares list.hint

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