Lipi Reference
Lipi

Functions

input.enum()

Adds a dropdown setting whose choices are the members of an enum you declare. It returns the chosen member, so the script can compare it with the members directly. Each member's title, the text after `=` in the enum declaration, is what the reader sees in the dropdown. `options` can limit the dropdown to some of the members.

Syntax

                input.enum(const  defval, const string title, const  options, const string tooltip, const string inline, const string group, const bool confirm) → input enum
              

Arguments

defval required const
title const string
options const
tooltip const string
inline const string
group const string
confirm const bool

Return Type

input enum

Example


          //@lipi=2
indicator("input.enum Example", overlay=true)
enum Source {
    closePrice = "Close"
    hl2Price = "High/Low Midpoint"
}
src = input.enum(Source.closePrice, "Price Source")
price = src == Source.closePrice ? close : hl2
plot(talib.sma(price, 20), title="SMA", color=color.blue)