Skip to content
AlertaChartAlertaScript / docs
AlertaScript / enum
On this pageSignatureReturnsExample

Metadata / Reference

enum

TradingView-compatible spelling: enum, runs without warnings

Pine v6: declares an enumerated type with named members. Members can optionally carry a title (used by str.tostring and input.enum dropdowns) and behave as identity-stable runtime values. `EnumName.all()` returns an array of every member in declaration order.

enum Name Member1 = "title1" Member2 → enum

Returns

enum

Example

enum Side    Long  = "long"    Short = "short"    Flat state = Side.LongmemberCount = array.size(Side.all())

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.