Built-in catalog
script reference
Change the indicator title shown on the chart. Use `pane.setTitle` for panes you declare.
Change the indicator title shown on the chart. Use pane.setTitle for panes you declare.
script.setTitle
script.setTitle(text: string) -> voidSets the title the chart shows for this script's indicator row.
text sets the title shown for the indicator. You can call this on every
update. The chart refreshes the title after the handler finishes when the text
has changed. Pass an empty string to restore the name declared with script "...".
Titles are limited to 256 UTF-8 bytes; longer text is shortened. Changing the
title only changes what is displayed. Saved settings, alerts, and the
indicator list keep using the script name. To change the title of a pane you
declared, call paneName.setTitle(text).
Example
script "RSI"
input len = input.int(14, title: "Length", min: 2, max: 200)
data chart = subscribe(data.ohlcv)
plot rsi = plot.line(title: "RSI")
on chart.update {
let v = ta.rsi(chart.close, len)
rsi.plot(v)
script.setTitle(str.format("RSI ({0}) {1:.1}", len, v ?? 0.0))
}