Lipi Reference Lipi

Functions

input()

Declares a setting the reader can change from the chart, picking its kind from the type of the default value you hand it. Six forms exist. Give it a bool and you get a bool back; give it a colour, a float, an int or a string and the same holds. The sixth takes a series and returns a `series float`, which is how you offer a choice of chart data without naming `input.source`. There are no bounds and no step here — for those, use `input.int` or `input.float`.

Syntax · 1 of 6

                input(const color defval, const string title, const string tooltip, const string inline, const string group, const bool confirm) → input color
              

Arguments

defval required const color The value the control starts at. Required, and its type is what selects the form.
title const string The label shown beside the control.
tooltip const string Help text for the control.
inline const string A key that puts several controls on one row.
group const string A heading the control sits under.
confirm const bool Asks the reader to confirm the value.

Return Type

input color

Syntax · 2 of 6

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

Arguments

defval required const string The value the control starts at. Required, and its type is what selects the form.
title const string The label shown beside the control.
tooltip const string Help text for the control.
inline const string A key that puts several controls on one row.
group const string A heading the control sits under.
confirm const bool Asks the reader to confirm the value.

Return Type

input string

Syntax · 3 of 6

                input(const int defval, const string title, const string tooltip, const string inline, const string group, const bool confirm) → input int
              

Arguments

defval required const int The value the control starts at. Required, and its type is what selects the form.
title const string The label shown beside the control.
tooltip const string Help text for the control.
inline const string A key that puts several controls on one row.
group const string A heading the control sits under.
confirm const bool Asks the reader to confirm the value.

Return Type

input int

Syntax · 4 of 6

                input(const float defval, const string title, const string tooltip, const string inline, const string group, const bool confirm) → input float
              

Arguments

defval required const float The value the control starts at. Required, and its type is what selects the form.
title const string The label shown beside the control.
tooltip const string Help text for the control.
inline const string A key that puts several controls on one row.
group const string A heading the control sits under.
confirm const bool Asks the reader to confirm the value.

Return Type

input float

Syntax · 5 of 6

                input(series float defval, const string title, const string tooltip, const string inline, const string group, const bool confirm) → series float
              

Arguments

defval required series float The value the control starts at. Required, and its type is what selects the form.
title const string The label shown beside the control.
tooltip const string Help text for the control.
inline const string A key that puts several controls on one row.
group const string A heading the control sits under.
confirm const bool Asks the reader to confirm the value.

Return Type

series float

Syntax · 6 of 6

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

Arguments

defval required const bool The value the control starts at. Required, and its type is what selects the form.
title const string The label shown beside the control.
tooltip const string Help text for the control.
inline const string A key that puts several controls on one row.
group const string A heading the control sits under.
confirm const bool Asks the reader to confirm the value.

Return Type

input bool

Example


          indicator("Customizable Moving Average", overlay=true)
length = input(14, title="SMA Length")
sma_value = talib.sma(close, length)
plot(sma_value, title="SMA", color=color.blue, linewidth=2)