input.source() - Pine Script Function
input.source()
Section titled “input.source()”Overview
Section titled “Overview”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.
Syntax
Section titled “Syntax”input.source(defval, title, tooltip, inline, group, display, active, confirm) → series floatParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| defval | open/high/low/close/hl2/hlc3/ohlc4/hlcc4 | Determines the default value of the input variable proposed in the script’s “Settings/Inputs” tab |
| from | — | where the user can change it. |
Returns
Section titled “Returns”Value of input variable.
Remarks
Section titled “Remarks”- Result of input.source function always should be assigned to a variable, see examples above.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("input.source", overlay=true)i_src = input.source(close, "Source")plot(i_src)