Sidechair

input.price()

Browse the reference

Adds a price-level setting to the script and returns the chosen number.

Try it in the editor

input.price returns a decimal number meant as a price level, starting at defval. Use it for manual support and resistance lines or alert levels.

The value is fixed for the whole run, so it can be passed straight to hline or compared with close.

Syntax

Pine Script
input.price(defval: const int/float, title: const string (optional), tooltip: const string (optional), inline: const string (optional), group: const string (optional), confirm: const bool (optional), display: const plot_display (optional), active: input bool (optional)) -> input float

Arguments

NameTypeDefaultDescription
defvalconst int/floatrequiredPrice the setting starts with, in the symbol's quote currency.
titleconst stringnaName shown in the Settings dialog, the legend and the Data Window.
tooltipconst stringnaText shown in a tooltip beside the input in the Settings dialog.
inlineconst stringnaEntries sharing the same inline text sit on one row of the Settings dialog.
groupconst stringnaHeading the input is listed under in the Settings dialog.
confirmconst boolfalseWhen true, the script asks for this value when it is first added to the chart.
displayconst plot_displaydisplay.allWhere the value appears: a display.* constant or a combination of them.
activeinput booltrueWhen false, the input is greyed out and cannot be edited.

Returns

input float: the chosen price level.

Remarks

  • On Sidechair: the setting is a number box; there is no click-on-chart picker.
  • On Sidechair: confirm, display and active are accepted and ignored.

Example

Pine ScriptManual levelOpen in editor
//@version=6
indicator("Manual level", overlay = true)
level = input.price(150.0, "Level")
plot(level, "Level", color = color.orange, linewidth = 2)
bgcolor(close > level ? color.new(color.green, 92) : na)

See also

Runs on Sidechair