MMTMMT Docs
Diagnostics

T407

handler on snapshot source

T407

Snapshot-only sources cannot drive update handlers. Subscribe to an event-capable leaf or read the snapshot from another handler.

Failing example

script "conf"

setup fam = for tf in [tf("2m"), tf("5m")] {
  subscribe(data.book)
}

plot out = plot.line(title: "out")

on fam.close(k, s) { out.plot(1.0) }

Corrected example

script "fixed"
data chart = subscribe(data.ohlcv)
data book = subscribe(data.book)
on chart.update { let bid = book.bestBid() }

On this page