Skip to content
Algo Trade Analytics Docs

input.float() - 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 field for a float input to the script’s inputs.

input.float(defval, title, options, tooltip, inline, group, confirm, display, active) → input float
NameTypeDescription
defvalconst int/floatDetermines the default value of the input variable proposed in the script’s “Settings/Inputs” tab
fromwhere script users can change it. When a list of values is used with the options parameter
thevalue must be one of them.

Value of input variable.

  • Result of input.float function always should be assigned to a variable, see examples above.
//@version=6
indicator("input.float", overlay=true)
i_angle1 = input.float(0.5, "Sin Angle", minval=-3.14, maxval=3.14, step=0.02)
plot(math.sin(i_angle1) > 0 ? close : open, "sin", color=color.green)i_angle2 = input.float(0, "Cos Angle", options=[-3.14, -1.57, 0, 1.57, 3.14])
plot(math.cos(i_angle2) > 0 ? close : open, "cos", color=color.red)