T303
type name is not UpperCamelCase
Severity Error
User type names must start with an uppercase letter and use UpperCamelCase, such as LiqCluster or SwingPoint. This keeps types visually distinct from values, which are written in lowerCamelCase.
Rename the type and every place it is used.
Failing example
script "Liquidation clusters"
data (
chart = subscribe(data.ohlcv)
liq = subscribe(data.liquidations)
)
type liq_cluster {
price: float
usd: float
}
state biggest: liq_cluster? = null
on chart.close {
let total = liq.total ?? 0.0
let b = biggest
if b == null || total > b.usd {
biggest = liq_cluster { price: chart.close ?? 0.0, usd: total }
}
}Fixed example
script "Liquidation clusters"
data (
chart = subscribe(data.ohlcv)
liq = subscribe(data.liquidations)
)
type LiqCluster {
price: float
usd: float
}
state biggest: LiqCluster? = null
on chart.close {
let total = liq.total ?? 0.0
let b = biggest
if b == null || total > b.usd {
biggest = LiqCluster { price: chart.close ?? 0.0, usd: total }
}
}