input.price() - Pine Script Function
input.price()
Section titled “input.price()”Overview
Section titled “Overview”Adds a price input to the script’s “Settings/Inputs” tab. The user can change the price in the settings or by selecting the indicator and dragging the price line.
Syntax
Section titled “Syntax”input.price(defval, title, tooltip, inline, group, confirm, display, active) → input floatParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| defval | const int/float | 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”- The user can change the input’s value by specifying a new value in the “Settings/Inputs” tab, or by moving the input’s marker on the chart. Alternatively, they can select “Reset points” from the script’s “More” menu and set a new input value by clicking a point on the chart.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("input.price", overlay=true)price1 = input.price(title="Date", defval=42)plot(price1)price2 = input.price(54, title="Date")plot(price2)