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.seriesand toshare.eventorshare.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
//@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
//@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)