MMTMMT Docs
Diagnostics

C006

mutation of a read-only subscription series

C006

Subscription data is read-only, even when you reach it through another name. Push into a series declared in state instead.

Failing example

script "example"
data chart = subscribe(data.ohlcv)
on chart.update { chart.close.push(1.0) }

Corrected example

script "fixed"
data chart = subscribe(data.ohlcv)
state owned = series<float>(2)
on chart.update { owned.push(chart.close ?? 0.0) }

On this page