FlowscopeDocs

T014

unused subscription

Severity Warning

A data subscription is declared but neither read nor driving a handler. Flowscope still has to load its history and keep its stream open, which costs memory and start-up time for nothing.

Remove the subscription, or use it: read its fields in a handler or attach a handler to it.

Failing example

Flowscope Script
script "Close only"
data (
  chart = subscribe(data.ohlcv)
  oi = subscribe(data.oi)
)
plot c = plot.line(title: "Close")
on chart.close {
  c.plot(chart.close)
}

Fixed example

Flowscope Script
script "Close only"
data chart = subscribe(data.ohlcv)
plot c = plot.line(title: "Close")
on chart.close {
  c.plot(chart.close)
}