Skip to content
Algo Trade Analytics Docs

input.source() - Pine Script Function

Adds an input to the Inputs tab of your script’s Settings, which allows you to provide configuration options to script users. This function adds a dropdown that allows the user to select a source for the calculation, e.g. close, hl2, etc. The user can also select an output from another indicator on their chart as the source.

input.source(defval, title, tooltip, inline, group, display, active, confirm) → series float
NameTypeDescription
defvalopen/high/low/close/hl2/hlc3/ohlc4/hlcc4Determines the default value of the input variable proposed in the script’s “Settings/Inputs” tab
fromwhere the user can change it.

Value of input variable.

  • Result of input.source function always should be assigned to a variable, see examples above.
//@version=6
indicator("input.source", overlay=true)
i_src = input.source(close, "Source")
plot(i_src)