Lipi Reference
Lipi

Functions

input.source()

Lets the reader pick which series the script reads — the close, the high, a midpoint, and so on. It is the exception in this namespace: it returns a `series float` rather than an input-form value, so what you get back can differ on every bar.

Syntax

                input.source(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 Determines the default value of the input variable proposed in the script's "Settings/Inputs" tab, from where the user can change it.
title const string Title of the input. If not specified, the variable name is used as the input's title. If the title is specified, but it is empty, the name will be an empty string.
tooltip const string The string that will be shown to the user when hovering over the tooltip icon.
inline const string Combines all the input calls using the same argument in one line. The string used as an argument is not displayed. It is only used to identify inputs belonging to the same line
group const string Creates a header above all inputs using the same group argument string. The string is also used as the header's text.
confirm const bool If true, then user will be asked to confirm input value before indicator is added to chart. Default value is false.

Return Type

series float

Example


          //@lipi=2
indicator("Custom Source Input", overlay=true)
src = input.source(close, title="Data Source")
smaValue = talib.sma(src, 14)
plot(smaValue, title="SMA", color=color.blue, linewidth=2)