input.symbol() - Pine Script Function
input.symbol()
Section titled “input.symbol()”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 field that allows the user to select a specific symbol using the symbol search and returns that symbol, paired with its exchange prefix, as a string.
Syntax
Section titled “Syntax”input.symbol(defval, title, tooltip, inline, group, confirm, display, active) → input stringParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| defval | const string | 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.symbol function always should be assigned to a variable, see examples above.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("input.symbol", overlay=true)i_sym = input.symbol("DELL", "Symbol")s = request.security(i_sym, 'D', close)plot(s)