MMTMMT Docs
Diagnostics

S014

color scale positions must be finite and in ascending order

S014

Color-scale positions must be finite and nondecreasing. Replace NaN/infinity and sort the stops.

Failing example

script "conf"

setup descending = color.scale(at: [1.0, 0.0], colors: [color.red, color.green])
setup nonFinite  = color.scale(at: [0.0, 1.0 / 0.0], colors: [color.red, color.green])

data chart = subscribe(data.ohlcv)
plot out = plot.line(title: "out")

on chart.update {
  out.plot(chart.close, color: descending.sample(0.5))
}

Corrected example

script "fixed"
setup scale = color.scale(at: [0.0, 1.0], colors: [#000000, #ffffff])

On this page