MMTMMT Docs
Diagnostics

T440

fill lines use different kinds of coordinates

T440

A line fill's two boundary lines must share one coordinate-space class: both chart space, both viewport-anchored, or both edge-anchored (anchor.top / anchor.bottom / anchor.left / anchor.right). Within the viewport and edge classes the two pools may use different anchors.

Failing example

script "conf"
data chart = subscribe(data.ohlcv)
state chartLines = entities.linePool(max: 2)
state viewportLines = entities.linePool(max: 2, anchor: anchor.topLeft)
state fills = entities.lineFillPool(max: 2)
on chart.update { fills.get("f").set(chartLines.get("a"), viewportLines.get("b")) }

Corrected example

script "fixed"
data chart = subscribe(data.ohlcv)
state upper = entities.linePool(max: 2, anchor: anchor.topLeft)
state lower = entities.linePool(max: 2, anchor: anchor.bottomLeft)
state fills = entities.lineFillPool(max: 2)
on chart.update { fills.get("f").set(upper.get("a"), lower.get("b")) }

On this page