Lipi Reference
Lipi

Functions

label()

Converts `value` to the `label` type. It is used almost only as `label(na)`, to declare a label variable that has no drawing yet, so that its type is known before the first drawing is assigned.

Syntax

                label(series label value) → series label
              

Arguments

value required series label

Return Type

series label

Example


          //@lipi=2
indicator("label() Example", overlay=true)
// Keep a single label, moved to the latest bar
static label lbl = label(na)
if barstate.islast {
    if not na(lbl) {
        label.delete(lbl)
    }
    lbl := label.new(bar_index, high, text="Last bar")
}