MMTMMT Docs
Diagnostics

T424

profile must be read through its own methods

T424

A profile handle must be the direct result binding of vol.profile(...) and used through its methods. Do not pass, return, or reshape the handle.

Failing example

script "example"
data chart = subscribe(data.ohlcv)
data vol = subscribe(data.volume)
on chart.update {
  let profile = true ? vol.profile(bars: 10) : vol.profile(bars: 20)
  let total = profile.total()
}

Corrected example

script "fixed"
data chart = subscribe(data.ohlcv)
data vol = subscribe(data.volume)
on chart.update { let profile = vol.profile(bars: 10)
  let total = profile.total() }

On this page