T005
unknown type name
Severity Error
A type annotation names a type that is neither built in (int, float, bool, string, color, time, duration, timeframe, session, the record types of data sources) nor declared with type in the script.
Correct the spelling, or declare the type. Note that there is a single floating-point type, float.
Failing example
script "Session peak"
data chart = subscribe(data.ohlcv)
state peak: double = 0.0
plot p = plot.line(title: "Peak")
on chart.close {
peak = math.max(peak, chart.high ?? peak)
p.plot(peak)
}Fixed example
script "Session peak"
data chart = subscribe(data.ohlcv)
state peak: float = 0.0
plot p = plot.line(title: "Peak")
on chart.close {
peak = math.max(peak, chart.high ?? peak)
p.plot(peak)
}