T002
duplicate top-level name
Severity Error
Two top-level declarations introduce the same name. Inputs, subscriptions, state, setup values, plots, panes, windows, alerts, types and functions all share one namespace.
Rename one of them so that every top-level binding is unique.
Failing example
script "Two averages"
data chart = subscribe(data.ohlcv)
plot avg = plot.line(title: "SMA 20", color: color.cyan)
plot avg = plot.line(title: "SMA 100", color: color.violet)
on chart.close {
avg.plot(ta.sma(chart.close, 20))
}Fixed example
script "Two averages"
data chart = subscribe(data.ohlcv)
plot fast = plot.line(title: "SMA 20", color: color.cyan)
plot slow = plot.line(title: "SMA 100", color: color.violet)
on chart.close {
fast.plot(ta.sma(chart.close, 20))
slow.plot(ta.sma(chart.close, 100))
}