Skip to content
AlertaChartAlertaScript / docs
AlertaScript / library
On this pageSignatureParametersReturnsExampleNotes

Metadata / Reference

library

TradingView-compatible spelling: library, runs without warnings

Defines the script as a reusable library header. Pine v6 libraries are imported via `import author/libraryName/version`. The body may contain `export` function declarations that become callable from importing scripts.

library(title, overlay, dynamic_requests) → void

Parameters

NameTypeRequiredDefaultDescription
titlestringYes—Library title.
overlayboolNo—Whether library helpers default to drawing on the main chart (informational; the engine ignores this for the library header itself).
dynamic_requestsboolNo—When true allows callers to invoke `request.*` family from within exported functions (Pine v6).

Returns

void

Example

library("My Toolkit", overlay=true)export hl2avg(simple int len) =>    ta.sma(hl2, len)

Notes

  • Use only one script header: indicator OR strategy OR library OR study.
  • Pine v6 `export` prefix declares a function callable from importing scripts. The keyword is accepted; in the script itself the function works as a normal function.

Names and aliases

Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.

AlertaScript

No results found.

Search by name, alias, or keyword.